[PATCH 2 of 2] py3: make files use absolute_import

Yuya Nishihara yuya at tcha.org
Thu Jul 7 10:21:04 EDT 2016


On Thu, 7 Jul 2016 14:22:09 +0100, Martijn Pieters wrote:
> On 5 July 2016 at 21:42, Pulkit Goyal <7895pulkit at gmail.com> wrote:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pulkit at gmail.com>
> > # Date 1467748954 -19800
> > #      Wed Jul 06 01:32:34 2016 +0530
> > # Node ID 22abe104ec6ab6c34e819a53aef7561e4a1620b0
> > # Parent  3862789efd2393c6ed7bfb856521d45fe17de105
> > py3: make files use absolute_import
> >
> > This patch adds absolute_import to two files in which it was difficult to follow
> > importing conventions. To prevent producing unstable outputs in the test-check-module-imports,
> >  the files are added to the list of bad files which import-checker will skip.
> 
> What happens when these are not added to the import-checker blacklist?
> Is there some unstable ordering somewhere?

Our import-checker gets confused if a module is imported relative to the
main script. In the following example, "polib" is considered a local module,
but reordering "polib" and "re" would raise another warning.

> > +from __future__ import absolute_import
> > +
> >  import polib
> >  import re

We'll need to fix the import-checker.


More information about the Mercurial-devel mailing list