Message145650
| Author |
ncoghlan |
| Recipients |
brett.cannon, glchapman, gvanrossum, isandler, jhylton, ncoghlan, prescod, terry.reedy |
| Date |
2011年10月16日.23:01:04 |
| SpamBayes Score |
1.4240382e-08 |
| Marked as misclassified |
No |
| Message-id |
<1318806065.09.0.441157196829.issue415492@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It's fairly easy to check this is still a problem:
$ ./python
Python 3.3.0a0 (default:a06ef7ab7321, Sep 22 2011, 13:41:29)
[GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setup
>>> setup.__file__
'setup.py'
That's a relative path rather than an absolute one. If you edit sys.path to use '.' instead of '', it becomes clear that the import machinery is just doing a blind join of the sys.path entry with the relative location of the file:
>>> del sys.modules['setup']
>>> sys.path[0] = '.'
>>> import setup
>>> setup.__file__
'./setup.py' |
|