File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,8 @@ def get_root_path(import_name):
484
484
directory = os .path .dirname (sys .modules [import_name ].__file__ )
485
485
return os .path .abspath (directory )
486
486
except AttributeError :
487
+ # this is necessary in case we are running from the interactive
488
+ # python shell. It will never be used for production code however
487
489
return os .getcwd ()
488
490
489
491
@@ -499,6 +501,7 @@ def find_package(import_name):
499
501
root_mod = sys .modules [import_name .split ('.' )[0 ]]
500
502
package_path = getattr (root_mod , '__file__' , None )
501
503
if package_path is None :
504
+ # support for the interactive python shell
502
505
package_path = os .getcwd ()
503
506
else :
504
507
package_path = os .path .abspath (os .path .dirname (package_path ))
You can’t perform that action at this time.
0 commit comments