run-tests: add support for RTUNICODEPEDANTRY environment variable
authortimeless <timeless@mozdev.org>
Tue, 05 Apr 2016 01:35:58 +0000
changeset 29282 89822d7a9d5f
parent 29281 9ac309946df9
child 29283 14eee72c8d52
run-tests: add support for RTUNICODEPEDANTRY environment variable based on 73e4a02e6d23
tests/run-tests.py
--- a/tests/run-tests.py	Fri May 27 05:24:45 2016 +0000
+++ b/tests/run-tests.py	Tue Apr 05 01:35:58 2016 +0000
@@ -69,6 +69,13 @@
 from xml.dom import minidom
 import unittest
 
+if os.environ.get('RTUNICODEPEDANTRY', False):
+    try:
+        reload(sys)
+        sys.setdefaultencoding("undefined")
+    except NameError:
+        pass
+
 osenvironb = getattr(os, 'environb', os.environ)
 processlock = threading.Lock()