Patchwork [1,of,7] hg: limit HGUNICODEPEDANTRY to py2

login
register
mail settings
Submitter timeless
Date May 11, 2016, 5:20 a.m.
Message ID <3f54a96b83308821064b.1462944023@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/14992/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

timeless - May 11, 2016, 5:20 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459820136 0
#      Tue Apr 05 01:35:36 2016 +0000
# Node ID 3f54a96b83308821064b1426c6bf347123ea9e59
# Parent  c5dfd864d81f5d1f435ff376ea44b3ea82b12575
# EXP-Topic runtests
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r 3f54a96b8330
hg: limit HGUNICODEPEDANTRY to py2

reload is not available in py3, and py3 is fatal anyway
Yuya Nishihara - May 16, 2016, 2:19 p.m.
On Wed, 11 May 2016 05:20:23 +0000, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459820136 0
> #      Tue Apr 05 01:35:36 2016 +0000
> # Node ID 3f54a96b83308821064b1426c6bf347123ea9e59
> # Parent  c5dfd864d81f5d1f435ff376ea44b3ea82b12575
> # EXP-Topic runtests
> # Available At bb://timeless/mercurial-crew
> #              hg pull bb://timeless/mercurial-crew -r 3f54a96b8330
> hg: limit HGUNICODEPEDANTRY to py2

Pushed the first 4 patches to the committed repo, thanks.

Patch

diff -r c5dfd864d81f -r 3f54a96b8330 hg
--- a/hg	Wed May 11 01:46:11 2016 +0000
+++ b/hg	Tue Apr 05 01:35:36 2016 +0000
@@ -11,9 +11,11 @@ 
 import sys
 
 if os.environ.get('HGUNICODEPEDANTRY', False):
-    reload(sys)
-    sys.setdefaultencoding("undefined")
-
+    try:
+        reload(sys)
+        sys.setdefaultencoding("undefined")
+    except NameError:
+        pass
 
 libdir = '@LIBDIR@'