Patchwork D9004: hgdemandimport: bypass demandimport for _ast module (issue6407)

login
register
mail settings
Submitter phabricator
Date Sept. 9, 2020, 6:49 p.m.
Message ID <differential-rev-PHID-DREV-x4gj5o6y2l4u5bxgg27w-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47116/
State Superseded
Headers show

Comments

phabricator - Sept. 9, 2020, 6:49 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is broken on Python 3.9rc1, and while it sounds like there may be
  a fix in Python, we probably also should have this workaround in place
  in hg. See the bug for more details (including on bugs at redhat and
  b.p.o).

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D9004

AFFECTED FILES
  hgdemandimport/__init__.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
Pierre-Yves David - Sept. 23, 2020, 7:10 a.m.
Now that a fix as landed in python 3.9 should we back this out ?

On 9/9/20 8:49 PM, durin42 (Augie Fackler) wrote:
> durin42 created this revision.
> Herald added a reviewer: hg-reviewers.
> Herald added a subscriber: mercurial-patches.
> 
> REVISION SUMMARY
>    This is broken on Python 3.9rc1, and while it sounds like there may be
>    a fix in Python, we probably also should have this workaround in place
>    in hg. See the bug for more details (including on bugs at redhat and
>    b.p.o).
> 
> REPOSITORY
>    rHG Mercurial
> 
> BRANCH
>    stable
> 
> REVISION DETAIL
>    https://phab.mercurial-scm.org/D9004
> 
> AFFECTED FILES
>    hgdemandimport/__init__.py
> 
> CHANGE DETAILS
> 
> diff --git a/hgdemandimport/__init__.py b/hgdemandimport/__init__.py
> --- a/hgdemandimport/__init__.py
> +++ b/hgdemandimport/__init__.py
> @@ -46,6 +46,7 @@
>       # setuptools' pkg_resources.py expects "from __main__ import x" to
>       # raise ImportError if x not defined
>       '__main__',
> +    '_ast', # https://bugs.python.org/issue41631
>       '_ssl',  # conditional imports in the stdlib, issue1964
>       '_sre',  # issue4920
>       'rfc822',
> 
> 
> 
> To: durin42, #hg-reviewers
> Cc: mercurial-patches, mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/hgdemandimport/__init__.py b/hgdemandimport/__init__.py
--- a/hgdemandimport/__init__.py
+++ b/hgdemandimport/__init__.py
@@ -46,6 +46,7 @@ 
     # setuptools' pkg_resources.py expects "from __main__ import x" to
     # raise ImportError if x not defined
     '__main__',
+    '_ast', # https://bugs.python.org/issue41631
     '_ssl',  # conditional imports in the stdlib, issue1964
     '_sre',  # issue4920
     'rfc822',