Last active
August 29, 2015 14:23
-
-
Save nailor/7f4ddb3a76c325b5bab5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[~/tmp/ppathtest]$ mkdir bar | |
[~/tmp/ppathtest]$ mkdir foo/package | |
[~/tmp/ppathtest]$ mkdir bar/package | |
[~/tmp/ppathtest]$ echo '__import__("pkg_resources").declare_namespace(__name__)' > bar/package/__init__.py | |
[~/tmp/ppathtest]$ echo '__import__("pkg_resources").declare_namespace(__name__)' > foo/package/__init__.py | |
[~/tmp/ppathtest]$ touch foo/package/herp.py | |
[~/tmp/ppathtest]$ touch bar/package/herp.py | |
[~/tmp/ppathtest]$ tree | |
. | |
├── bar | |
│ └── package | |
│ ├── __init__.py | |
│ ├── __init__.pyc | |
│ ├── herp.py | |
│ └── herp.pyc | |
└── foo | |
└── package | |
├── __init__.py | |
├── __init__.pyc | |
├── herp.py | |
└── herp.pyc | |
[~/tmp/ppathtest]$ PYTHONPATH=bar:foo python2.6 -c 'from package import herp; print herp.__file__' | |
/Users/jyrki/tmp/ppathtest/bar/package/herp.py | |
[~/tmp/ppathtest]$ PYTHONPATH=bar:foo python2.7 -c 'from package import herp; print herp.__file__' | |
/Users/jyrki/tmp/ppathtest/foo/package/herp.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment