changeset 29172:2ea9c9aa6e60

hg: limit HGUNICODEPEDANTRY to py2 reload is not available in py3, and py3 is fatal anyway
author timeless <timeless@mozdev.org>
date Tue, 05 Apr 2016 01:35:36 +0000
parents de28dedd1ff1
children fa9fae9a9372
files hg
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hg	Fri May 13 02:58:15 2016 +0530
+++ 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@'