Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d3165a

Browse files
author
Greg Stein
committed
only put __path__ into package modules.
1 parent 63faa01 commit 6d3165a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/imputil.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def _fs_import(dir, modname):
436436

437437
pathname = _os_path_join(dir, modname)
438438
if _os_path_isdir(pathname):
439-
values = { '__pkgdir__' : pathname }
439+
values = { '__pkgdir__' : pathname, '__path__' : [ pathname ] }
440440
ispkg = 1
441441
pathname = _os_path_join(pathname, '__init__')
442442
else:
@@ -609,7 +609,6 @@ def get_code(self, parent, modname, fqname):
609609
for dir in sys.path:
610610
result = _fs_import(dir, modname)
611611
if result:
612-
result[2]['__path__'] = [ dir ] # backwards compat
613612
return result
614613

615614
# not found

0 commit comments

Comments
 (0)