Message202248
| Author |
durin42 |
| Recipients |
durin42, twouters |
| Date |
2013年11月06日.00:27:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1383697659.1.0.717023788788.issue19510@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
While tinkering (again) with Mercurial Python 3 messes, I ran across this gem:
import error, osutil, encoding, collections
(http://selenic.com/hg/file/e1317d3e59e1/mercurial/util.py#l17)
That import statement contains 3 relative imports (that is, mercurial.error, mercurial.osutil, and mercurial.encoding), and one standard library import (collections). Because of the standard lib import on that line, lib2to3 doesn't rewrite any of the imports. If I instead move collections to its own line, then the first three imports get correctly rewritten to the "from . import error" form.
I've got Python 3.3.2 locally, and the lib2to3 is the one from that stdlib. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年11月06日 00:27:39 | durin42 | set | recipients:
+ durin42, twouters |
| 2013年11月06日 00:27:39 | durin42 | set | messageid: <1383697659.1.0.717023788788.issue19510@psf.upfronthosting.co.za> |
| 2013年11月06日 00:27:38 | durin42 | link | issue19510 messages |
| 2013年11月06日 00:27:38 | durin42 | create |
|