Message158304
| Author |
brett.cannon |
| Recipients |
Trundle, alex, benjamin.peterson, brett.cannon, eric.araujo, eric.smith, eric.snow, ncoghlan, pitrou, python-dev, roger.serwy, vstinner |
| Date |
2012年04月15日.00:53:23 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334451204.73.0.794958712811.issue2377@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I committed the fix. Thanks for testing, Roger.
As for the change in semantics, I'm fully aware it is not backwards-compatible. Unfortunately the incorrect usage was not even discovered until I started my bootstrap work because the import statement does the right thing but __import__() itself was never updated so it is only noticeable if you never updated your code to use importlib.import_module() which has been the preferred way to programmatically import code since Python 2.7/3.1. Plus the correct semantics are documented in PEP 328 (http://python.org/dev/peps/pep-0328/) and referenced in the language spec (http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement) so I'm not going to change it back since this brings the function more in line with expectations. And since the fix is as simple as a try/except and two import calls then it falls within the realm of having to fix code for any new Python release.
And as for the crash, I will have a look. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月15日 00:53:24 | brett.cannon | set | recipients:
+ brett.cannon, ncoghlan, pitrou, vstinner, eric.smith, benjamin.peterson, roger.serwy, eric.araujo, alex, Trundle, python-dev, eric.snow |
| 2012年04月15日 00:53:24 | brett.cannon | set | messageid: <1334451204.73.0.794958712811.issue2377@psf.upfronthosting.co.za> |
| 2012年04月15日 00:53:24 | brett.cannon | link | issue2377 messages |
| 2012年04月15日 00:53:23 | brett.cannon | create |
|