"import spot.foo" may now load "spot-extra/foo.py"
This is needed for tcltl. * python/spot/__init__.py: Alter __path__ to add any spot-extra/ directory we find. * NEWS: Mention this.
This commit is contained in:
parent
865427c73b
commit
2960b8138c
2 changed files with 16 additions and 0 deletions
|
|
@ -36,6 +36,16 @@ if 'SPOT_UNINSTALLED' in os.environ:
|
|||
# into .libs/
|
||||
__path__.extend(sys.path)
|
||||
|
||||
# We may have third-party plugins that want to be loaded as "spot.xxx", but
|
||||
# that are installed in a different $prefix. This sets things so that any
|
||||
# file that looks like spot-extra/xxx.py can be loaded with "import spot.xxx".
|
||||
for path in sys.path:
|
||||
if path not in __path__:
|
||||
path += "/spot-extra"
|
||||
if os.path.isdir(path):
|
||||
__path__.append(path)
|
||||
|
||||
|
||||
from spot.impl import *
|
||||
from spot.aux import \
|
||||
extend as _extend, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue