File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Open diff view settings
Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ def safeimport(path, forceload=0, cache={}):
448448 # Prevent garbage collection.
449449 cache [key ] = sys .modules [key ]
450450 del sys .modules [key ]
451- module = __import__ (path )
451+ module = importlib . import_module (path )
452452 except BaseException as err :
453453 # Did the error occur before or after the module was found?
454454 if path in sys .modules :
@@ -463,9 +463,6 @@ def safeimport(path, forceload=0, cache={}):
463463 else :
464464 # Some other error occurred during the importing process.
465465 raise ErrorDuringImport (path , err )
466- for part in path .split ('.' )[1 :]:
467- try : module = getattr (module , part )
468- except AttributeError : return None
469466 return module
470467
471468# ---------------------------------------------------- formatter base class
You can’t perform that action at this time.
0 commit comments