Bug 964379 - Ensure that mozinfo.info's keys are ASCII, not Unicode, r=gps
authorJoshua Cranmer <Pidgeot18@gmail.com>
Tue, 18 Feb 2014 10:41:39 -0600
changeset 169673 35240da28ab08ca6324166b385f9f5e3f101d50b
parent 169672 ae95fa9d4450086098434c83075e458eaef13864
child 169674 a299ef7c6d98e2619449b6b56a3171e8a41cb582
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersgps
bugs964379
milestone30.0a1
Bug 964379 - Ensure that mozinfo.info's keys are ASCII, not Unicode, r=gps
testing/xpcshell/runxpcshelltests.py
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -1302,23 +1302,22 @@ class XPCShellTests(object):
             if not os.path.isfile(mozInfoFile):
                 self.log.error("Error: couldn't find mozinfo.json at '%s'. Perhaps you need to use --build-info-json?" % mozInfoFile)
                 return False
             self.mozInfo = json.load(open(mozInfoFile))
 
         # mozinfo.info is used as kwargs.  Some builds are done with
         # an older Python that can't handle Unicode keys in kwargs.
         # All of the keys in question should be ASCII.
-        if 'info' in self.mozInfo:
-            fixedInfo = {}
-            for k, v in self.mozInfo['info'].items():
-                if isinstance(k, unicode):
-                    k = k.encode('ascii')
-                fixedInfo[k] = v
-            self.mozInfo['info'] = fixedInfo
+        fixedInfo = {}
+        for k, v in self.mozInfo.items():
+            if isinstance(k, unicode):
+                k = k.encode('ascii')
+            fixedInfo[k] = v
+        self.mozInfo = fixedInfo
 
         mozinfo.update(self.mozInfo)
 
         # buildEnvironment() needs mozInfo, so we call it after mozInfo is initialized.
         self.buildEnvironment()
 
         # The appDirKey is a optional entry in either the default or individual test
         # sections that defines a relative application directory for test runs. If