mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
If multiple directories in sys.path provide a nested namespace package, then jedi would only visit the first directory which contained the package. Fix this by saving the remaining path list in the ImplicitNamespaceValue and add a test for it.
19 lines
338 B
Python
19 lines
338 B
Python
import sys
|
|
import os
|
|
from os.path import dirname
|
|
|
|
sys.path.insert(0, os.path.join(dirname(__file__), 'namespace2'))
|
|
sys.path.insert(0, os.path.join(dirname(__file__), 'namespace1'))
|
|
|
|
#? ['mod1']
|
|
import pkg1.pkg2.mod1
|
|
|
|
#? ['mod2']
|
|
import pkg1.pkg2.mod2
|
|
|
|
#? ['mod1_name']
|
|
pkg1.pkg2.mod1.mod1_name
|
|
|
|
#? ['mod2_name']
|
|
pkg1.pkg2.mod2.mod2_name
|