This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:39durin42setrecipients: + durin42, twouters
2013-11-06 00:27:39durin42setmessageid: <1383697659.1.0.717023788788.issue19510@psf.upfronthosting.co.za>
2013-11-06 00:27:38durin42linkissue19510 messages
2013-11-06 00:27:38durin42create