Patchwork [01,of,11] py3: don't try to mangle C extension blob by code transformer

login
register
mail settings
Submitter Yuya Nishihara
Date March 3, 2018, 1:27 p.m.
Message ID <39f26de931737db2ee20.1520083654@mimosa>
Download mbox | patch
Permalink /patch/28766/
State Accepted
Headers show

Comments

Yuya Nishihara - March 3, 2018, 1:27 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1520074245 18000
#      Sat Mar 03 05:50:45 2018 -0500
# Node ID 39f26de931737db2ee20b90925f7b3eb56423a89
# Parent  cdf5ea49828ae71c8340b2806733ce49b4a549da
py3: don't try to mangle C extension blob by code transformer
Gregory Szorc - March 3, 2018, 3:13 p.m.
On Sat, Mar 3, 2018 at 8:27 AM, Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1520074245 18000
> #      Sat Mar 03 05:50:45 2018 -0500
> # Node ID 39f26de931737db2ee20b90925f7b3eb56423a89
> # Parent  cdf5ea49828ae71c8340b2806733ce49b4a549da
> py3: don't try to mangle C extension blob by code transformer
>

Queued this series. Thank you very much!

I'll reply to some parts individually with minor comments...


>
> diff --git a/mercurial/__init__.py b/mercurial/__init__.py
> --- a/mercurial/__init__.py
> +++ b/mercurial/__init__.py
> @@ -31,6 +31,9 @@ if sys.version_info[0] >= 3:
>              # Only handle Mercurial-related modules.
>              if not fullname.startswith(('mercurial.', 'hgext.',
> 'hgext3rd.')):
>                  return None
> +            # don't try to parse binary
> +            if fullname.startswith('mercurial.cext.'):
> +                return None
>              # third-party packages are expected to be dual-version clean
>              if fullname.startswith('mercurial.thirdparty'):
>                  return None
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/__init__.py b/mercurial/__init__.py
--- a/mercurial/__init__.py
+++ b/mercurial/__init__.py
@@ -31,6 +31,9 @@  if sys.version_info[0] >= 3:
             # Only handle Mercurial-related modules.
             if not fullname.startswith(('mercurial.', 'hgext.', 'hgext3rd.')):
                 return None
+            # don't try to parse binary
+            if fullname.startswith('mercurial.cext.'):
+                return None
             # third-party packages are expected to be dual-version clean
             if fullname.startswith('mercurial.thirdparty'):
                 return None