Patchwork [4,of,5,RFC] py3: do not eliminate ".pure." from modules unmarked as dual

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 13, 2016, 10:15 a.m.
Message ID <3d8b3e09190aaacc3c57.1471083326@mimosa>
Download mbox | patch
Permalink /patch/16271/
State Changes Requested
Headers show

Comments

Yuya Nishihara - Aug. 13, 2016, 10:15 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1471076518 -32400
#      Sat Aug 13 17:21:58 2016 +0900
# Node ID 3d8b3e09190aaacc3c57ae37b265838df4accb1a
# Parent  8bb0a9223bce791bae9e6a07238d6b9722e5577a
py3: do not eliminate ".pure." from modules unmarked as dual

This allows us to switch to policy.uimportvars() one by one.

Patch

diff --git a/mercurial/__init__.py b/mercurial/__init__.py
--- a/mercurial/__init__.py
+++ b/mercurial/__init__.py
@@ -162,7 +162,8 @@  if sys.version_info[0] >= 3:
             if not spec:
                 return None
 
-            if fullname.startswith('mercurial.pure.'):
+            if (fullname.startswith('mercurial.pure.')
+                and fullname.replace('.pure.', '.') in _dualmodules):
                 spec.name = spec.name.replace('.pure.', '.')
 
             # TODO need to support loaders from alternate specs, like zip