File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ def safeimport(path, forceload=0, cache={}):
448
448
# Prevent garbage collection.
449
449
cache [key ] = sys .modules [key ]
450
450
del sys .modules [key ]
451
- module = __import__ (path )
451
+ module = importlib . import_module (path )
452
452
except BaseException as err :
453
453
# Did the error occur before or after the module was found?
454
454
if path in sys .modules :
@@ -463,9 +463,6 @@ def safeimport(path, forceload=0, cache={}):
463
463
else :
464
464
# Some other error occurred during the importing process.
465
465
raise ErrorDuringImport (path , err )
466
- for part in path .split ('.' )[1 :]:
467
- try : module = getattr (module , part )
468
- except AttributeError : return None
469
466
return module
470
467
471
468
# ---------------------------------------------------- formatter base class
You can’t perform that action at this time.
0 commit comments