Skip to content
Snippets Groups Projects
Commit bc27b3f4 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[python] clean up

parent 1688bc47
No related branches found
No related tags found
No related merge requests found
......@@ -28,19 +28,6 @@ import os
import logging
def _register_special_funcs(mod, base_name=''):
if isinstance(mod, dict):
mod_dict = mod
else:
mod_dict = import_module('.{}'.format(mod), base_name).__dict__
if '_init_mpi' in mod_dict:
_init_mpi_calls.add(mod_dict['_init_mpi'])
if '_init_logger' in mod_dict:
_init_logger_calls.add(mod_dict['_init_logger'])
if '_test_logger' in mod_dict:
_test_logger_calls.add(mod_dict['_test_logger'])
def guarded_import(globs, base_name, mod_name):
# see https://stackoverflow.com/questions/43059267/how-to-do-from-module-import-using-importlib
try:
......@@ -49,8 +36,6 @@ def guarded_import(globs, base_name, mod_name):
names = mod.__dict__["__all__"]
else:
names = [x for x in mod.__dict__ if not x.startswith("_")]
# import special init functions which should be present in every module
_register_special_funcs(mod.__dict__)
# check the rest for duplicity
for nm in names:
if nm in globs:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment