[PATCH 2 of 3 v2] hghave: add demandimport checking
Gábor STEFANIK
Gabor.STEFANIK at nng.com
Thu Aug 25 18:57:10 EDT 2016
>
--------------------------------------------------------------------------
This message, including its attachments, is confidential. For more information please read NNG's email policy here:
http://www.nng.com/emailpolicy/
By responding to this email you accept the email policy.
-----Original Message-----
> From: Mercurial-devel [mailto:mercurial-devel-bounces at mercurial-scm.org]
> On Behalf Of timeless
> Sent: Friday, August 26, 2016 12:42 AM
> To: mercurial-devel at mercurial-scm.org
> Subject: [PATCH 2 of 3 v2] hghave: add demandimport checking
>
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1472164235 0
> # Thu Aug 25 22:30:35 2016 +0000
> # Node ID 2122bf277e3ad68bd59d1d5cea79fea137b09c5a
> # Parent d240f3e2d0d3f2be06ca5a7b04fa4b6d99e695ff
> # Available At https://bitbucket.org/timeless/mercurial-crew
> # hg pull https://bitbucket.org/timeless/mercurial-crew -r
> 2122bf277e3a
> hghave: add demandimport checking
>
> diff -r d240f3e2d0d3 -r 2122bf277e3a tests/hghave.py
> --- a/tests/hghave.pyThu Aug 25 22:03:51 2016 +0000
> +++ b/tests/hghave.pyThu Aug 25 22:30:35 2016 +0000
> @@ -522,6 +522,11 @@
> br'other supported Python versions')
> return dpkg and dh and dh_py2
>
> + at check("demandimport", "demandimport enabled") def
> has_demandimport():
> + return not ('HGDEMANDIMPORT' in os.environ and
> + os.environ['HGDEMANDIMPORT'] == 'disable')
Again, more concise with os.environ.get().
> +
> @check("absimport", "absolute_import in __future__") def
> has_absimport():
> import __future__
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list