Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > da60448d06ba269023fccb344dcb6a3b > files > 19

firefox-31.1.0-6.el5.src.rpm

diff -up mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/__init__.py.python3 mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/__init__.py
--- mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/__init__.py.python3	2014-08-25 15:16:56.000000000 +0200
+++ mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/__init__.py	2014-09-05 15:26:13.994680630 +0200
@@ -318,7 +318,10 @@ def parse_args(arguments, global_options
         # a[0][1] = long name
         names = []
         for seq in (a, b):
-            names.append(seq[0][0][1:] if seq[0][0] else seq[0][1][2:])
+            if seq[0][0]:
+              names.append(seq[0][0][1:])
+            else:
+              names.append(seq[0][1][2:])
         return cmp(*names)
 
     global_options.sort(name_cmp)
diff -up mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/rdf.py.python3 mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/rdf.py
--- mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/rdf.py.python3	2014-08-25 15:16:56.000000000 +0200
+++ mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/rdf.py	2014-09-05 15:26:13.995680635 +0200
@@ -131,7 +131,7 @@ def gen_manifest(template_root_dir, targ
     # XPIs remain packed by default, but package.json can override that. The
     # RDF format accepts "true" as True, anything else as False. We expect
     # booleans in the .json file, not strings.
-    manifest.set("em:unpack", "true" if target_cfg.get("unpack") else "false")
+    manifest.set("em:unpack", ("false", "true")[target_cfg.get("unpack")])
 
     for translator in target_cfg.get("translators", [ ]):
         elem = dom.createElement("em:translator");
diff -up mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/runner.py.python3 mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/runner.py
--- mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/runner.py.python3	2014-08-25 15:16:56.000000000 +0200
+++ mozilla-esr31/addon-sdk/source/python-lib/cuddlefish/runner.py	2014-09-05 15:26:13.995680635 +0200
@@ -293,8 +293,7 @@ class XulrunnerAppRunner(mozrunner.Runne
 
     profile_class = XulrunnerAppProfile
 
-    # This is a default, and will be overridden in the instance if
-    # Firefox is used in XULRunner mode.
+    # This is a default, and will be overridden in the instance if # Firefox is used in XULRunner mode.
     names = ['xulrunner']
 
     # Default location of XULRunner on OS X.
diff -up mozilla-esr31/b2g/simulator/build_xpi.py.python3 mozilla-esr31/b2g/simulator/build_xpi.py
--- mozilla-esr31/b2g/simulator/build_xpi.py.python3	2014-08-25 15:16:57.000000000 +0200
+++ mozilla-esr31/b2g/simulator/build_xpi.py	2014-09-05 15:26:13.995680635 +0200
@@ -40,9 +40,11 @@ class GaiaBuilder(object):
     def override_prefs(self, srcfile):
         # Note that each time we call `make profile` in gaia, a fresh new pref file is created
         # cat srcfile >> profile/user.js
-        with open(os.path.join(self.gaia_path, "profile", "user.js"), "a") as userJs:
+        userJs = open(os.path.join(self.gaia_path, "profile", "user.js"), "a")
+        if 1:
             userJs.write(open(srcfile).read())
 
+        userJs.close()
 def process_package_overload(src, dst, version, app_buildid):
     ensureParentDir(dst)
     # First replace numeric version like '1.3'
@@ -57,10 +59,14 @@ def process_package_overload(src, dst, v
     }
     pp = Preprocessor(defines=defines)
     pp.do_filter("substitution")
-    with open(dst, "w") as output:
-        with open(src, "r") as input:
+    output = open(dst, "w")
+    if 1:
+        input = open(src, "r")
+        if 1:
             pp.processFile(input=input, output=output)
 
+        input.close()
+    output.close()
 def add_dir_to_zip(zip, top, pathInZip, blacklist=()):
     zf = ZipFile(zip, "a")
     for dirpath, subdirs, files in os.walk(top):
diff -up mozilla-esr31/browser/locales/filter.py.python3 mozilla-esr31/browser/locales/filter.py
--- mozilla-esr31/browser/locales/filter.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/browser/locales/filter.py	2014-09-05 15:26:13.995680635 +0200
@@ -20,12 +20,12 @@ def test(mod, path, entity = None):
     if mod == "extensions/spellcheck":
       return "ignore"
     # browser
-    return "ignore" if re.match(r"searchplugins\/.+\.xml", path) else "error"
+    return ("error", "ignore")[re.match(r"searchplugins\/.+\.xml", path)]
   if mod == "extensions/spellcheck":
     # l10n ships en-US dictionary or something, do compare
     return "error"
   if path == "defines.inc":
-    return "ignore" if entity == "MOZ_LANGPACK_CONTRIBUTORS" else "error"
+    return ("error", "ignore")[entity == "MOZ_LANGPACK_CONTRIBUTORS"]
 
   if mod == "browser" and path == "chrome/browser-region/region.properties":
     # only region.properties exceptions remain, compare all others
diff -up mozilla-esr31/build/appini_header.py.python3 mozilla-esr31/build/appini_header.py
--- mozilla-esr31/build/appini_header.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/appini_header.py	2014-09-05 15:26:13.996680640 +0200
@@ -25,8 +25,15 @@ def main(file):
             flags.add('NS_XRE_ENABLE_CRASH_REPORTER')
     except: pass
     appdata = dict(("%s:%s" % (s, o), config.get(s, o)) for s in config.sections() for o in config.options(s))
-    appdata['flags'] = ' | '.join(flags) if flags else '0'
-    appdata['App:profile'] = '"%s"' % appdata['App:profile'] if 'App:profile' in appdata else 'NULL'
+    if flags:
+      appdata['flags'] = ' | '.join(flags)
+    else:
+      appdata['flags'] = '0'
+    if 'App:profile' in appdata:
+      appdata['App:profile'] = '"%s"' % appdata['App:profile']
+    else:
+      appdata['App:profile'] = 'NULL'
+    #appdata['flags'] = ' | '.join(flags)flags else '0' appdata['App:profile'] = '"%s"' % appdata['App:profile'] if 'App:profile' in appdata = ('NULL', )[]
     expected = ('App:vendor', 'App:name', 'App:version', 'App:buildid',
                 'App:id', 'Gecko:minversion', 'Gecko:maxversion')
     missing = [var for var in expected if var not in appdata]
diff -up mozilla-esr31/build/autoconf/config.status.m4.python3 mozilla-esr31/build/autoconf/config.status.m4
--- mozilla-esr31/build/autoconf/config.status.m4.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/autoconf/config.status.m4	2014-09-05 15:26:13.996680640 +0200
@@ -133,7 +133,8 @@ rm confdefs.pytmp confdefs.h
 cat >> $CONFIG_STATUS <<\EOF
 ] ]
 
-substs = [(name[1:-1], value[1:-1] if isinstance(value, types.StringTypes) else value) for name, value in [
+substs = []
+mylist = [
 EOF
 
 dnl The MOZ_DIVERSION_SUBST output diversion contains AC_SUBSTs, in the
@@ -149,7 +150,12 @@ for ac_subst_arg in $_subconfigure_ac_su
 done
 
 cat >> $CONFIG_STATUS <<\EOF
-] ]
+]
+for name, value in mylist:
+  if isinstance(value, types.StringTypes):
+    substs.append( (name[1:-1], value[1:-1]) )
+  else:
+    substs.append( (name[1:-1], value) )
 
 dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES
 non_global_defines = [
diff -up mozilla-esr31/build/automationutils.py.python3 mozilla-esr31/build/automationutils.py
--- mozilla-esr31/build/automationutils.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/automationutils.py	2014-09-05 15:26:13.996680640 +0200
@@ -3,7 +3,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 import glob, logging, os, platform, shutil, subprocess, sys, tempfile, urllib2, zipfile
 import base64
 import re
@@ -102,8 +102,7 @@ class ZipFileReader(object):
 
   def _getnormalizedpath(self, path):
     """
-    Gets a normalized path from 'path' (or the current working directory if
-    'path' is None). Also asserts that the path exists.
+    Gets a normalized path from 'path' (or the current working directory if 'path' is None). Also asserts that the path exists.
     """
     if path is None:
       path = os.curdir
@@ -123,9 +122,11 @@ class ZipFileReader(object):
       path = os.path.split(filename)[0]
       if not os.path.isdir(path):
         os.makedirs(path)
-      with open(filename, "wb") as dest:
+      dest = open(filename, "wb")
+      if 1:
         dest.write(self._zipfile.read(name))
 
+      dest.close()
   def namelist(self):
     return self._zipfile.namelist()
 
@@ -281,9 +282,11 @@ def dumpLeakLog(leakLogFile, filter = Fa
   if not os.path.exists(leakLogFile):
     return
 
-  with open(leakLogFile, "r") as leaks:
+  leaks = open(leakLogFile, "r")
+  if 1:
     leakReport = leaks.read()
 
+  leaks.close()
   # Only |XPCOM_MEM_LEAK_LOG| reports can be actually filtered out.
   # Only check whether an actual leak was reported.
   if filter and not "0 TOTAL " in leakReport:
@@ -312,7 +315,8 @@ def processSingleLeakFile(leakLogFileNam
   totalBytesLeaked = None
   leakAnalysis = []
   leakedObjectNames = []
-  with open(leakLogFileName, "r") as leaks:
+  leaks = open(leakLogFileName, "r")
+  if 1:
     for line in leaks:
       if line.find("purposefully crash") > -1:
         crashedOnPurpose = True
@@ -340,6 +344,7 @@ def processSingleLeakFile(leakLogFileNam
         leakedObjectNames.append(name)
         leakAnalysis.append("TEST-INFO | leakcheck |%s leaked %d %s (%s bytes)"
                             % (processString, numLeaked, name, bytesLeaked))
+  leaks.close()
   log.info('\n'.join(leakAnalysis))
 
   if totalBytesLeaked is None:
@@ -451,7 +456,11 @@ def systemMemory():
 def environment(xrePath, env=None, crashreporter=True, debugger=False, dmdPath=None):
   """populate OS environment variables for mochitest"""
 
-  env = os.environ.copy() if env is None else env
+  env = None
+  if env is None:
+    env = os.environ.copy()
+  else:
+    env = env
 
   assert os.path.isabs(xrePath)
 
diff -up mozilla-esr31/build/checksums.py.python3 mozilla-esr31/build/checksums.py
--- mozilla-esr31/build/checksums.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/checksums.py	2014-09-05 15:26:13.997680645 +0200
@@ -3,7 +3,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 
 from optparse import OptionParser
 import logging
@@ -26,13 +26,15 @@ def digest_file(filename, digest, chunk_
     if hashlib is not None:
         logger.debug('Creating new %s object' % digest)
         h = hashlib.new(digest)
-        with open(filename, 'rb') as f:
+        f = open(filename, 'rb')
+        if 1:
             while True:
                 data = f.read(chunk_size)
                 if not data:
                     logger.debug('Finished reading in file')
                     break
                 h.update(data)
+        f.close()
         hash = h.hexdigest()
         logger.debug('Hash for %s is %s' % (filename, hash))
         return hash
@@ -65,7 +67,8 @@ def process_files(files, output_filename
                      output_filename)
     else:
         logger.debug('Creating a new checksums file "%s"' % output_filename)
-    with open(output_filename, 'w+') as output:
+    output = open(output_filename, 'w+')
+    if 1:
         for file in files:
             if os.path.isdir(file):
                 logger.warn('%s is a directory, skipping' % file)
@@ -85,6 +88,7 @@ def process_files(files, output_filename
                                                      os.path.getsize(file),
                                                      short_file)
 
+    output.close()
 def setup_logging(level=logging.DEBUG):
     '''This function sets up the logging module using a speficiable logging
     module logging level.  The default log level is DEBUG.
diff -up mozilla-esr31/build/compare-mozconfig/compare-mozconfigs.py.python3 mozilla-esr31/build/compare-mozconfig/compare-mozconfigs.py
--- mozilla-esr31/build/compare-mozconfig/compare-mozconfigs.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/compare-mozconfig/compare-mozconfigs.py	2014-09-05 15:26:13.997680645 +0200
@@ -5,7 +5,7 @@
 
 # originally from http://hg.mozilla.org/build/tools/file/4ab9c1a4e05b/scripts/release/compare-mozconfigs.py
 
-from __future__ import unicode_literals
+
 
 import logging
 import os
diff -up mozilla-esr31/build/compare-mozconfig/compare-mozconfigs-wrapper.py.python3 mozilla-esr31/build/compare-mozconfig/compare-mozconfigs-wrapper.py
--- mozilla-esr31/build/compare-mozconfig/compare-mozconfigs-wrapper.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/compare-mozconfig/compare-mozconfigs-wrapper.py	2014-09-05 15:26:13.997680645 +0200
@@ -3,7 +3,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import subprocess
 import sys
diff -up mozilla-esr31/build/gyp.mozbuild.python3 mozilla-esr31/build/gyp.mozbuild
--- mozilla-esr31/build/gyp.mozbuild.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/gyp.mozbuild	2014-09-05 15:26:13.997680645 +0200
@@ -8,10 +8,10 @@ gyp_vars = {
     'build_with_mozilla': 1,
     'build_with_chromium': 0,
     'use_official_google_api_keys': 0,
-    'have_clock_monotonic': 1 if CONFIG['HAVE_CLOCK_MONOTONIC'] else 0,
-    'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0,
-    'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0,
-    'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0,
+    'have_clock_monotonic': (0, 1)[CONFIG['HAVE_CLOCK_MONOTONIC'] == '1'],
+    'have_ethtool_cmd_speed_hi': (0, 1)[CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] == '1'],
+    'include_alsa_audio': (0, 1)[CONFIG['MOZ_ALSA'] == '1'],
+    'include_pulse_audio': (0, 1)[CONFIG['MOZ_PULSEAUDIO'] == '1'],
     # basic stuff for everything
     'include_internal_video_render': 0,
     'clang_use_chrome_plugins': 0,
@@ -26,7 +26,7 @@ gyp_vars = {
     'build_libvpx': 0,
     'build_libyuv': 0,
     'libyuv_dir': '/media/libyuv',
-    'yuv_disable_avx2': 0 if CONFIG['HAVE_X86_AVX2'] else 1,
+    'yuv_disable_avx2': (1, 0)[CONFIG['HAVE_X86_AVX2'] == '1'],
 
     # saves 4MB when webrtc_trace is off
     'enable_lazy_trace_alloc': 1,
@@ -57,7 +57,7 @@ os = CONFIG['OS_TARGET']
 if os == 'WINNT':
     gyp_vars.update(
         MSVS_VERSION=CONFIG['_MSVS_VERSION'],
-        MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_OS'] else 32,
+        MSVS_OS_BITS=(32, 64)[CONFIG['HAVE_64BIT_OS'] == '1'],
     )
 elif os == 'Android':
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
@@ -73,9 +73,9 @@ elif os == 'Android':
 
 flavors = {
     'WINNT': 'win',
-    'Android': 'linux' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' else 'android',
+    'Android': ('android', 'linux')[CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk'],
     'Linux': 'linux',
-    'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
+    'Darwin': ('ios', 'mac')[CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa'],
     'SunOS': 'solaris',
     'GNU/kFreeBSD': 'freebsd',
     'DragonFly': 'dragonfly',
diff -up mozilla-esr31/build/link.py.python3 mozilla-esr31/build/link.py
--- mozilla-esr31/build/link.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/link.py	2014-09-05 15:26:13.997680645 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 import os, subprocess, sys, threading, time
 from win32 import procmem
 
@@ -25,9 +25,11 @@ def measure_vsize_threadfunc(proc, outpu
           sys.stdout.flush()
           idleTime = 0
     print "TinderboxPrint: linker max vsize: %d" % maxvsize
-    with open(output_file, "w") as f:
+    f = open(output_file, "w")
+    if 1:
         f.write("%d\n" % maxvsize)
 
+    f.close()
 def measure_link_vsize(output_file, args):
     """
     Execute |args|, and measure the maximum virtual memory usage of the process,
diff -up mozilla-esr31/build/mach_bootstrap.py.python3 mozilla-esr31/build/mach_bootstrap.py
--- mozilla-esr31/build/mach_bootstrap.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/mach_bootstrap.py	2014-09-05 15:26:13.998680650 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import platform
@@ -150,7 +154,7 @@ def bootstrap(topsrcdir, mozilla_dir=Non
         if not os.path.exists(state_env_dir):
             print('Creating global state directory from environment variable: %s'
                 % state_env_dir)
-            os.makedirs(state_env_dir, mode=0o770)
+            os.makedirs(state_env_dir, mode=0770)
             print('Please re-run mach.')
             sys.exit(1)
         state_dir = state_env_dir
diff -up mozilla-esr31/build/pgo/genpgocert.py.python3 mozilla-esr31/build/pgo/genpgocert.py
--- mozilla-esr31/build/pgo/genpgocert.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pgo/genpgocert.py	2014-09-05 15:26:13.998680650 +0200
@@ -52,7 +52,7 @@ def runUtil(util, args, inputdata = None
     else:
       env[pathvar] = app_path
   proc = subprocess.Popen([util] + args, env=env,
-                          stdin=subprocess.PIPE if inputdata else None)
+                          stdin=(None, subprocess.PIPE)[inputdata])
   proc.communicate(inputdata)
   return proc.returncode
 
@@ -68,7 +68,8 @@ def createCertificateAuthority(build, sr
 
   #TODO: mozfile.TemporaryDirectory
   tempDbDir = tempfile.mkdtemp()
-  with NamedTemporaryFile() as pwfile, NamedTemporaryFile() as rndfile:
+  pwfile, NamedTemporaryFile() = rndfile = NamedTemporaryFile().__enter__()
+  if 1:
     pgoCAModulePathSrc = os.path.join(srcDir, "pgoca.p12")
     pgoCAPathSrc = os.path.join(srcDir, "pgoca.ca")
 
@@ -92,6 +93,7 @@ def createCertificateAuthority(build, sr
     if status:
       return status
 
+  rndfile.__exit__(0, 0, 0)
   shutil.rmtree(tempDbDir)
   return 0
 
@@ -100,7 +102,8 @@ def createSSLServerCertificate(build, sr
   certutil = build.get_binary_path(what="certutil")
   pk12util = build.get_binary_path(what="pk12util")
 
-  with NamedTemporaryFile() as pwfile, NamedTemporaryFile() as rndfile:
+  pwfile, NamedTemporaryFile() = rndfile = NamedTemporaryFile().__enter__()
+  if 1:
     pgoCAPath = os.path.join(srcDir, "pgoca.p12")
 
     pwfile.write("\n")
@@ -159,6 +162,7 @@ def createSSLServerCertificate(build, sr
       if status:
         return status
 
+  rndfile.__exit__(0, 0, 0)
   return 0
 
 if len(sys.argv) == 1:
diff -up mozilla-esr31/build/pymake/pymake/builtins.py.python3 mozilla-esr31/build/pymake/pymake/builtins.py
--- mozilla-esr31/build/pymake/pymake/builtins.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/pymake/builtins.py	2014-09-05 15:26:13.999680655 +0200
@@ -109,7 +109,10 @@ def touch(args):
                     y += 1900
                 return y
             if m.group(f) is None:
-                return localtime()[0] if f == 'Y' else 0
+                if f == 'Y':
+                  return localtime()[0]
+                else:
+                  return 0
             return int(m.group(f))
         time = [normalized_field(m, f) for f in ['Y', 'M', 'D', 'h', 'm', 's']] + [0, 0, -1]
         time = mktime(time)
diff -up mozilla-esr31/build/pymake/pymake/data.py.python3 mozilla-esr31/build/pymake/pymake/data.py
--- mozilla-esr31/build/pymake/pymake/data.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/pymake/data.py	2014-09-05 15:26:14.000680659 +0200
@@ -53,7 +53,10 @@ def getmtime(path):
 def stripdotslash(s):
     if s.startswith('./'):
         st = s[2:]
-        return st if st != '' else '.'
+        if st != '':
+          return st
+        else:
+          return '.'
     return s
 
 def stripdotslashes(sl):
diff -up mozilla-esr31/build/pymake/pymake/functions.py.python3 mozilla-esr31/build/pymake/pymake/functions.py
--- mozilla-esr31/build/pymake/pymake/functions.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/pymake/functions.py	2014-09-05 15:26:14.000680659 +0200
@@ -27,8 +27,10 @@ def emit_expansions(descend, *expansions
 class Function(object):
     """
     An object that represents a function call. This class is always subclassed
-    with the following methods and attributes:
+    the following methods and attributes.__enter__()
+    if 1:
 
+    the following methods and attributes.__exit__(0, 0, 0)
     minargs = minimum # of arguments
     maxargs = maximum # of arguments (0 means unlimited)
 
diff -up mozilla-esr31/build/pymake/pymake/process.py.python3 mozilla-esr31/build/pymake/pymake/process.py
--- mozilla-esr31/build/pymake/pymake/process.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/pymake/process.py	2014-09-05 15:26:14.001680664 +0200
@@ -382,7 +382,7 @@ class PythonJob(Job):
             if self.module not in sys.modules:
                 try:
                     __import__(self.module)
-                except Exception as e:
+                except Exception, e:
                     print >>sys.stderr, 'Error importing %s: %s' % (
                         self.module, e)
                     return -127
@@ -396,7 +396,7 @@ class PythonJob(Job):
                 print >>sys.stderr, (
                     "Native command '%s %s' returned value '%s'" %
                     (self.module, self.method, rv))
-                return (rv if isinstance(rv, int) else 1)
+                return ((1, rv)[isinstance(rv, int)])
 
         except PythonException, e:
             print >>sys.stderr, e
diff -up mozilla-esr31/build/pymake/tests/formattingtests.py.python3 mozilla-esr31/build/pymake/tests/formattingtests.py
--- mozilla-esr31/build/pymake/tests/formattingtests.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/tests/formattingtests.py	2014-09-05 15:26:14.001680664 +0200
@@ -253,9 +253,11 @@ class MakefileCorupusTest(TestBase):
                 continue
 
             source = None
-            with open(makefile, 'rU') as fh:
+            fh = open(makefile, 'rU')
+            if 1:
                 source = fh.read()
 
+            fh.close()
             try:
                 yield (makefile, source, parsestring(source, makefile))
             except SyntaxError:
diff -up mozilla-esr31/build/pymake/tests/pycmd.py.python3 mozilla-esr31/build/pymake/tests/pycmd.py
--- mozilla-esr31/build/pymake/tests/pycmd.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/tests/pycmd.py	2014-09-05 15:26:14.001680664 +0200
@@ -1,15 +1,20 @@
 import os, sys, subprocess
 
 def writetofile(args):
-  with open(args[0], 'w') as f:
+  f = open(args[0], 'w')
+  if 1:
     f.write(' '.join(args[1:]))
 
+  f.close()
 def writeenvtofile(args):
-  with open(args[0], 'w') as f:
+  f = open(args[0], 'w')
+  if 1:
     f.write(os.environ[args[1]])
 
+  f.close()
 def writesubprocessenvtofile(args):
-  with open(args[0], 'w') as f:
+  f = open(args[0], 'w')
+  if 1:
     p = subprocess.Popen([sys.executable, "-c",
                           "import os; print os.environ['%s']" % args[1]],
                           stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -17,11 +22,12 @@ def writesubprocessenvtofile(args):
     assert p.returncode == 0
     f.write(stdout)
 
+  f.close()
 def convertasplode(arg):
   try:
     return int(arg)
   except:
-    return (None if arg == "None" else arg)
+    return ((arg, None)[arg == "None"])
 
 def asplode(args):
   arg0 = convertasplode(args[0])
diff -up mozilla-esr31/build/pymake/tests/subdir/pymod.py.python3 mozilla-esr31/build/pymake/tests/subdir/pymod.py
--- mozilla-esr31/build/pymake/tests/subdir/pymod.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/pymake/tests/subdir/pymod.py	2014-09-05 15:26:14.001680664 +0200
@@ -1,5 +1,8 @@
 import testmodule
 
 def writetofile(args):
-  with open(args[0], 'w') as f:
+  f = open(args[0], 'w')
+  if 1:
     f.write(' '.join(args[1:]))
+  f.close()
+
diff -up mozilla-esr31/build/subconfigure.py.python3 mozilla-esr31/build/subconfigure.py
--- mozilla-esr31/build/subconfigure.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/subconfigure.py	2014-09-05 15:26:14.002680669 +0200
@@ -63,11 +63,13 @@ PRECIOUS_VARS = set([
 def maybe_clear_cache():
     comment = re.compile(r'^\s+#')
     cache = {}
-    with open('config.cache') as f:
+    f = open('config.cache')
+    if 1:
         for line in f.readlines():
             if not comment.match(line) and '=' in line:
                 key, value = line.split('=', 1)
                 cache[key] = value
+    f.close()
     for precious in PRECIOUS_VARS:
         entry = 'ac_cv_env_%s_value' % precious
         if entry in cache and (not precious in os.environ or os.environ[precious] != cache[entry]):
@@ -87,9 +89,10 @@ def dump(dump_file, shell):
 
     # Scan the config.status output for information about configuration files
     # it generates.
-    config_status_output = subprocess.check_output(
-        [shell, '-c', './config.status --help'],
-        stderr=subprocess.STDOUT).splitlines()
+    config_status_output = subprocess.Popen([shell, '-c', './config.status --help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].splitlines()
+    #config_status_output = subprocess.check_output(
+    #    [shell, '-c', './config.status --help'],
+    #    stderr=subprocess.STDOUT).splitlines()
     state = None
     for line in config_status_output:
         if line.startswith('Configuration') and line.endswith(':'):
@@ -101,10 +104,12 @@ def dump(dump_file, shell):
                 if os.path.isfile(f):
                     config_files.append(File(f))
 
-    with open(dump_file, 'wb') as f:
+    f = open(dump_file, 'wb')
+    if 1:
         pickle.dump(config_files, f)
 
 
+    f.close()
 def adjust(dump_file, configure):
     if not os.path.exists(dump_file):
         return
@@ -112,8 +117,10 @@ def adjust(dump_file, configure):
     config_files = []
 
     try:
-        with open(dump_file, 'rb') as f:
+        f = open(dump_file, 'rb')
+        if 1:
             config_files = pickle.load(f)
+        f.close()
     except Exception:
         pass
 
@@ -134,4 +141,7 @@ if __name__ == '__main__':
     if sys.argv[1] == 'dump':
         dump(CONFIG_DUMP, sys.argv[2])
     elif sys.argv[1] == 'adjust':
-        adjust(CONFIG_DUMP, sys.argv[2] if len(sys.argv) > 2 else None)
+        if len(sys.argv) > 2:
+           adjust(CONFIG_DUMP, sys.argv[2])
+        else:
+           adjust(CONFIG_DUMP,  None)
diff -up mozilla-esr31/build/unix/add_phony_targets.py.python3 mozilla-esr31/build/unix/add_phony_targets.py
--- mozilla-esr31/build/unix/add_phony_targets.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/unix/add_phony_targets.py	2014-09-05 15:26:14.002680669 +0200
@@ -24,10 +24,12 @@ def add_phony_targets(path):
     phony_targets = deps - targets
     if not phony_targets:
         return
-    with open(path, 'a') as f:
+    f = open(path, 'a')
+    if 1:
         f.writelines('%s:\n' % d for d in phony_targets)
 
 
+    f.close()
 if __name__ == '__main__':
     for f in sys.argv[1:]:
         add_phony_targets(f)
diff -up mozilla-esr31/build/unix/build-clang/tooltool.py.python3 mozilla-esr31/build/unix/build-clang/tooltool.py
--- mozilla-esr31/build/unix/build-clang/tooltool.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/unix/build-clang/tooltool.py	2014-09-05 15:26:14.002680669 +0200
@@ -86,8 +86,10 @@ class FileRecord(object):
 
     def validate_digest(self):
         if self.present():
-            with open(self.filename, 'rb') as f:
+            f = open(self.filename, 'rb')
+            if 1:
                 return self.digest == digest_file(f, self.algorithm)
+            f.close()
         else:
             log.debug("trying to validate digest on a missing file, %s', self.filename")
             raise MissingFileException(filename=self.filename)
@@ -265,9 +267,11 @@ def open_manifest(manifest_file):
     """I know how to take a filename and load it into a Manifest object"""
     if os.path.exists(manifest_file):
         manifest = Manifest()
-        with open(manifest_file) as f:
+        f = open(manifest_file)
+        if 1:
             manifest.load(f)
             log.debug("loaded manifest from file '%s'" % manifest_file)
+        f.close()
         return manifest
     else:
         log.debug("tried to load absent file '%s' as manifest" % manifest_file)
@@ -282,8 +286,7 @@ def list_manifest(manifest_file):
         log.error("failed to load manifest file at '%s'" % manifest_file)
         return False
     for f in manifest.file_records:
-        print "%s\t%s\t%s" % ("P" if f.present() else "-",
-                              "V" if f.present() and f.validate() else "-",
+        print "%s\t%s\t%s" % (("P", "-")[f.present() else "-", "V" if f.present() and f.validate()],
                               f.filename)
     return True
 
@@ -345,8 +348,10 @@ def add_files(manifest_file, algorithm,
             log.debug("added '%s' to manifest" % filename)
         else:
             all_files_added = False
-    with open(manifest_file, 'wb') as output:
+    output = open(manifest_file, 'wb')
+    if 1:
         new_manifest.dump(output, fmt='json')
+    output.close()
     return all_files_added
 
 
@@ -364,8 +369,10 @@ def fetch_file(base_url, file_record, ov
             log.info("overwriting '%s' as requested" % file_record.filename)
         else:
             # All of the following is for a useful error message
-            with open(file_record.filename, 'rb') as f:
+            f = open(file_record.filename, 'rb')
+            if 1:
                 d = digest_file(f, file_record.algorithm)
+            f.close()
             log.error("digest mismatch between manifest(%s...) and local file(%s...)" % \
                     (file_record.digest[:8], d[:8]))
             log.debug("full digests: manifest (%s) local file (%s)" % (file_record.digest, d))
@@ -382,7 +389,8 @@ def fetch_file(base_url, file_record, ov
     try:
         f = urllib2.urlopen(url)
         log.debug("opened %s for reading" % url)
-        with open(file_record.filename, 'wb') as out:
+        out = open(file_record.filename, 'wb')
+        if 1:
             k = True
             size = 0
             while k:
@@ -398,7 +406,8 @@ def fetch_file(base_url, file_record, ov
                             file_record.filename, file_record.size - size))
                 return False
             log.info("fetched %s" % file_record.filename)
-    except (urllib2.URLError, urllib2.HTTPError) as e:
+        out.close()
+    except (urllib2.URLError, urllib2.HTTPError), e:
         log.error("failed to fetch '%s': %s" % (file_record.filename, e),
                   exc_info=True)
         return False
@@ -544,7 +553,7 @@ def main():
             try:
                 options[option] = cfg_file.get('general', option)
                 log.debug("read '%s' as '%s' from cfg_file" % (option, options[option]))
-            except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) as e:
+            except (ConfigParser.NoSectionError, ConfigParser.NoOptionError), e:
                 log.debug("%s in config file" % e, exc_info=True)
 
     if not options.has_key('manifest'):
@@ -552,7 +561,7 @@ def main():
 
     if len(args) < 1:
         parser.error('You must specify a command')
-    exit(0 if process_command(options, args) else 1)
+    exit((1, 0)[process_command(options, args)])
 
 if __name__ == "__main__":
     main()
diff -up mozilla-esr31/build/util/hg.py.python3 mozilla-esr31/build/util/hg.py
--- mozilla-esr31/build/util/hg.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/util/hg.py	2014-09-05 15:26:14.003680674 +0200
@@ -140,8 +140,7 @@ def clone(repo, dest, branch=None, revis
     If `revision` is set, only the specified revision and its ancestors will
     be cloned.
 
-    If `update_dest` is set, then `dest` will be updated to `revision` if
-    set, otherwise to `branch`, otherwise to the head of default.
+    If `update_dest` is set, then `dest` will be updated to `revision` if set, otherwise to `branch`, otherwise to the head of default.
 
     If `mirrors` is set, will try and clone from the mirrors before
     cloning from `repo`.
@@ -242,8 +241,7 @@ def common_args(revision=None, branch=No
 def pull(repo, dest, update_dest=True, mirrors=None, **kwargs):
     """Pulls changes from hg repo and places it in `dest`.
 
-    If `update_dest` is set, then `dest` will be updated to `revision` if
-    set, otherwise to `branch`, otherwise to the head of default.
+    If `update_dest` is set, then `dest` will be updated to `revision` if set, otherwise to `branch`, otherwise to the head of default.
 
     If `mirrors` is set, will try and pull from the mirrors first before
     `repo`."""
@@ -262,8 +260,7 @@ def pull(repo, dest, update_dest=True, m
     repo = _make_absolute(repo)
     cmd = ['hg', 'pull']
     # Don't pass -r to "hg pull", except when it's a valid HG revision.
-    # Pulling using tag names is dangerous: it uses the local .hgtags, so if
-    # the tag has moved on the remote side you won't pull the new revision the
+    # Pulling using tag names is dangerous: it uses the local .hgtags, so if # the tag has moved on the remote side you won't pull the new revision the
     # remote tag refers to.
     pull_kwargs = kwargs.copy()
     if 'revision' in pull_kwargs and \
diff -up mozilla-esr31/build/valgrind/mach_commands.py.python3 mozilla-esr31/build/valgrind/mach_commands.py
--- mozilla-esr31/build/valgrind/mach_commands.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/valgrind/mach_commands.py	2014-09-05 15:26:14.003680674 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import re
@@ -62,7 +66,8 @@ class MachCommands(MachCommandBase):
         httpd = MozHttpd(docroot=os.path.join(build_dir, 'pgo'))
         httpd.start(block=False)
 
-        with TemporaryDirectory() as profilePath:
+        profilePath = TemporaryDirectory().__enter__()
+        if 1:
             #TODO: refactor this into mozprofile
             prefpath = os.path.join(self.topsrcdir, 'testing', 'profiles', 'prefs_general.js')
             prefs = {}
@@ -156,3 +161,5 @@ class MachCommands(MachCommandBase):
                 httpd.stop()
 
             return status
+        profilePath.__exit__(0, 0, 0)
+
diff -up mozilla-esr31/build/valgrind/output_handler.py.python3 mozilla-esr31/build/valgrind/output_handler.py
--- mozilla-esr31/build/valgrind/output_handler.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/valgrind/output_handler.py	2014-09-05 15:26:14.003680674 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import re
 
@@ -28,8 +32,7 @@ class OutputHandler(object):
     It buffers these lines from which text is extracted so that the
     TEST-UNEXPECTED-FAIL message can be printed before the full error.
 
-    Parsing the Valgrind output isn't ideal, and it may break in the future if
-    Valgrind changes the format of the messages, or introduces new error kinds.
+    Parsing the Valgrind output isn't ideal, and it may break in the future if Valgrind changes the format of the messages, or introduces new error kinds.
     To protect against this, we also count how many lines containing
     "<insert_a_suppression_name_here>" are seen. Thanks to the use of
     --gen-suppressions=yes, exactly one of these lines is present per error. If
diff -up mozilla-esr31/build/virtualenv_packages.txt.python3 mozilla-esr31/build/virtualenv_packages.txt
--- mozilla-esr31/build/virtualenv_packages.txt.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/build/virtualenv_packages.txt	2014-09-05 15:26:14.003680674 +0200
@@ -22,3 +22,5 @@ copy:build/buildconfig.py
 packages.txt:testing/mozbase/packages.txt
 objdir:build
 gyp.pth:media/webrtc/trunk/tools/gyp/pylib
+rebase.pth:rebase
+action.pth:python/mozbuild/action
diff -up mozilla-esr31/client.mk.python3 mozilla-esr31/client.mk
--- mozilla-esr31/client.mk.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/client.mk	2014-09-05 15:26:14.004680679 +0200
@@ -137,7 +137,8 @@ endif
 
 # Automatically add -jN to make flags if not defined. N defaults to number of cores.
 ifeq (,$(findstring -j,$(MOZ_MAKE_FLAGS)))
-  cores=$(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
+  #cores=$(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
+  cores=1 # $(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
   MOZ_MAKE_FLAGS += -j$(cores)
 endif
 
diff -up mozilla-esr31/config/configobj.py.python3 mozilla-esr31/config/configobj.py
--- mozilla-esr31/config/configobj.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/configobj.py	2014-09-05 15:26:14.004680679 +0200
@@ -542,8 +542,7 @@ class Section(dict):
         (We have to special case 'Section' instances - which are also dicts)
         
         Keys must be strings.
-        Values need only be strings (or lists of strings) if
-        ``main.stringify`` is set.
+        Values need only be strings (or lists of strings) if ``main.stringify`` is set.
         
         `unrepr`` must be set when setting a value to a dictionary, without
         creating a new sub-section.
diff -up mozilla-esr31/config/expandlibs_exec.py.python3 mozilla-esr31/config/expandlibs_exec.py
--- mozilla-esr31/config/expandlibs_exec.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/expandlibs_exec.py	2014-09-05 15:26:14.005680684 +0200
@@ -20,7 +20,7 @@ With the --symbol-order argument, follow
 relevant linker options to change the order in which the linker puts the
 symbols appear in the resulting binary. Only works for ELF targets.
 '''
-from __future__ import with_statement
+
 import sys
 import os
 from expandlibs import (
@@ -186,8 +186,10 @@ class ExpandArgsMore(ExpandArgs):
     def orderSymbols(self, order):
         '''Given a file containing a list of symbols, adds the appropriate
         argument to make the linker put the symbols in that order.'''
-        with open(order) as file:
+        file = open(order)
+        if 1:
             sections = self._getOrderedSections([l.strip() for l in file.readlines() if l.strip()])
+        file.close()
         split_sections = {}
         linked_sections = [s[0] for s in SECTION_INSERT_BEFORE]
         for s in sections:
@@ -292,8 +294,10 @@ def print_command(out, args):
     print >>out, "Executing: " + " ".join(args)
     for tmp in [f for f in args.tmp if os.path.isfile(f)]:
         print >>out, tmp + ":"
-        with open(tmp) as file:
+        file = open(tmp)
+        if 1:
             print >>out, "".join(["    " + l for l in file.readlines()])
+        file.close()
     out.flush()
 
 def main():
@@ -322,7 +326,8 @@ def main():
             deps.pop(0)
         # Remove command
         deps.pop(0)
-    with ExpandArgsMore(args) as args:
+    args = ExpandArgsMore(args).__enter__()
+    if 1:
         if options.extract:
             args.extract()
         if options.symbol_order:
@@ -344,6 +349,7 @@ def main():
         sys.stderr.flush()
         if proc.returncode:
             exit(proc.returncode)
+    args.__exit__(0, 0, 0)
     if not options.depend:
         return
     ensureParentDir(options.depend)
@@ -355,8 +361,10 @@ def main():
     if len(deps) != len(no_dynamic_lib):
         mk.create_rule(['%s_order_only' % options.target]).add_dependencies(dep for dep in deps if isDynamicLib(dep))
 
-    with open(options.depend, 'w') as depfile:
+    depfile = open(options.depend, 'w')
+    if 1:
         mk.dump(depfile, removal_guard=True)
 
+    depfile.close()
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/config/expandlibs_gen.py.python3 mozilla-esr31/config/expandlibs_gen.py
--- mozilla-esr31/config/expandlibs_gen.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/expandlibs_gen.py	2014-09-05 15:26:14.005680684 +0200
@@ -5,7 +5,7 @@
 '''Given a list of object files and library names, prints a library
 descriptor to standard output'''
 
-from __future__ import with_statement
+
 import sys
 import os
 import expandlibs_config as conf
@@ -39,12 +39,17 @@ if __name__ == '__main__':
         raise Exception("Missing option: -o")
 
     ensureParentDir(options.output)
-    with open(options.output, 'w') as outfile:
+    outfile = open(options.output, 'w')
+    if 1:
         print >>outfile, generate(args)
+    outfile.close()
     if options.depend:
         ensureParentDir(options.depend)
-        with open(options.depend, 'w') as depfile:
+        depfile = open(options.depend, 'w')
+        if 1:
             deps = ExpandLibsDeps(args)
             depfile.write("%s : %s\n" % (options.output, ' '.join(deps)))
             for dep in deps:
                 depfile.write("%s :\n" % dep)
+        depfile.close()
+
diff -up mozilla-esr31/config/expandlibs.py.python3 mozilla-esr31/config/expandlibs.py
--- mozilla-esr31/config/expandlibs.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/expandlibs.py	2014-09-05 15:26:14.005680684 +0200
@@ -26,9 +26,10 @@ ${LIB_PREFIX}${ROOT}.${LIB_SUFFIX} follo
   descriptor contains. And for each of these LIBS, also apply the same
   rules.
 '''
-from __future__ import with_statement
+
 import sys, os, errno
 import expandlibs_config as conf
+from rhrebase import all, any
 
 def ensureParentDir(file):
     '''Ensures the directory parent to the given file exists'''
@@ -125,8 +126,10 @@ class ExpandArgs(list):
     def _expand_desc(self, arg):
         '''Internal function taking care of lib descriptor expansion only'''
         if os.path.exists(arg + conf.LIBS_DESC_SUFFIX):
-            with open(arg + conf.LIBS_DESC_SUFFIX, 'r') as f:
+            f = open(arg + conf.LIBS_DESC_SUFFIX, 'r')
+            if 1:
                 desc = LibDescriptor(f.readlines())
+            f.close()
             objs = [relativize(o) for o in desc['OBJS']]
             for lib in desc['LIBS']:
                 objs += self._expand(lib)
diff -up mozilla-esr31/config/Makefile.in.python3 mozilla-esr31/config/Makefile.in
--- mozilla-esr31/config/Makefile.in.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/Makefile.in	2014-09-05 15:26:14.005680684 +0200
@@ -66,7 +66,7 @@ export-preqs = \
   $(NULL)
 
 export:: $(export-preqs)
-	$(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \
+	$(PYTHON) $(topsrcdir)/python/mozbuild/mozbuild/action/preprocessor.py $(DEFINES) $(ACDEFINES) \
 		-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
 		-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
 		-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
diff -up mozilla-esr31/config/makefiles/functions.mk.python3 mozilla-esr31/config/makefiles/functions.mk
--- mozilla-esr31/config/makefiles/functions.mk.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/makefiles/functions.mk	2014-09-05 15:26:14.006680689 +0200
@@ -30,5 +30,6 @@ core_winabspath = $(error core_winabspat
 ifdef .PYMAKE
 py_action = %mozbuild.action.$(1) main $(2)
 else
-py_action = $(PYTHON) -m mozbuild.action.$(1) $(2)
+#py_action = $(PYTHON) -m mozbuild.action.$(1) $(2)
+py_action = $(PYTHON) $(topsrcdir)/python/mozbuild/mozbuild/action/$(1).py $(2)
 endif
diff -up mozilla-esr31/config/make-stl-wrappers.py.python3 mozilla-esr31/config/make-stl-wrappers.py
--- mozilla-esr31/config/make-stl-wrappers.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/make-stl-wrappers.py	2014-09-05 15:26:14.006680689 +0200
@@ -1,10 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import print_function
 import os, re, string, sys
 from mozbuild.util import FileAvoidWrite
 
+
+def print24(msg, file=sys.stdout, end="\n"):
+  file.write(msg + end)
+
 def find_in_path(file, searchpath):
     for dir in searchpath.split(os.pathsep):
         f = os.path.join(dir, file)
@@ -33,22 +36,26 @@ def main(outdir, compiler, template_file
     path_to_new = header_path('new', compiler)
 
     for header in open(header_list_file, 'r'):
+        #print "NEW HEADER" + header
         header = header.rstrip()
         if 0 == len(header) or is_comment(header):
             continue
 
         path = header_path(header, compiler)
-        with FileAvoidWrite(os.path.join(outdir, header)) as f:
+        f = FileAvoidWrite(os.path.join(outdir, header)).__enter__()
+        if 1:
             f.write(string.Template(template).substitute(HEADER=header,
                                                          HEADER_PATH=path,
                                                          NEW_HEADER_PATH=path_to_new))
+        #f.__exit(0, 0, 0)
+        f.close()
 
 
 if __name__ == '__main__':
     if 5 != len(sys.argv):
-        print("""Usage:
-  python {0} OUT_DIR ('msvc'|'gcc') TEMPLATE_FILE HEADER_LIST_FILE
-""".format(sys.argv[0]), file=sys.stderr)
+        print24("""Usage:
+  python %s OUT_DIR ('msvc'|'gcc') TEMPLATE_FILE HEADER_LIST_FILE
+""" % (sys.argv[0]), file=sys.stderr)
         sys.exit(1)
 
     main(*sys.argv[1:])
diff -up mozilla-esr31/config/mozunit.py.python3 mozilla-esr31/config/mozunit.py
--- mozilla-esr31/config/mozunit.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/mozunit.py	2014-09-05 15:26:14.006680689 +0200
@@ -93,18 +93,22 @@ class MockedOpen(object):
     Context manager diverting the open builtin such that opening files
     can open "virtual" file instances given when creating a MockedOpen.
 
-    with MockedOpen({'foo': 'foo', 'bar': 'bar'}):
+    MockedOpen({'foo': 'foo', 'bar': 'bar'}).__enter__()
+    if 1:
         f = open('foo', 'r')
 
+    MockedOpen({'foo': 'foo', 'bar': 'bar'}).__exit__(0, 0, 0)
     will thus open the virtual file instance for the file 'foo' to f.
 
     MockedOpen also masks writes, so that creating or replacing files
     doesn't touch the file system, while subsequently opening the file
     will return the recorded content.
 
-    with MockedOpen():
+    MockedOpen().__enter__()
+    if 1:
         f = open('foo', 'w')
         f.write('foo')
+    MockedOpen().__exit__(0, 0, 0)
     self.assertRaises(Exception,f.open('foo', 'r'))
     '''
     def __init__(self, files = {}):
diff -up mozilla-esr31/config/nsinstall.py.python3 mozilla-esr31/config/nsinstall.py
--- mozilla-esr31/config/nsinstall.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/nsinstall.py	2014-09-05 15:26:14.006680689 +0200
@@ -9,7 +9,6 @@
 # a full build environment set up.
 # The basic limitation is, it doesn't even try to link and ignores
 # all related options.
-from __future__ import print_function
 from optparse import OptionParser
 import os
 import os.path
@@ -17,6 +16,9 @@ import sys
 import shutil
 import stat
 
+def print24(msg, file=sys.stdout, end="\n"):
+  file.write(msg + end)
+
 def _nsinstall_internal(argv):
   usage = "usage: %prog [options] arg1 [arg2 ...] target-directory"
   p = OptionParser(usage=usage)
@@ -65,7 +67,7 @@ def _nsinstall_internal(argv):
     dir = os.path.abspath(dir)
     if os.path.exists(dir):
       if not os.path.isdir(dir):
-        print('nsinstall: {0} is not a directory'.format(dir), file=sys.stderr)
+        print24('nsinstall: %s is not a directory' % (dir), file=sys.stderr)
         return 1
       if mode:
         os.chmod(dir, mode)
@@ -76,7 +78,7 @@ def _nsinstall_internal(argv):
         os.makedirs(dir, mode)
       else:
         os.makedirs(dir)
-    except Exception as e:
+    except Exception, e:
       # We might have hit EEXIST due to a race condition (see bug 463411) -- try again once
       if try_again:
         return maybe_create_dir(dir, mode, False)
diff -up mozilla-esr31/config/rebuild_check.py.python3 mozilla-esr31/config/rebuild_check.py
--- mozilla-esr31/config/rebuild_check.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/rebuild_check.py	2014-09-05 15:26:14.007680694 +0200
@@ -8,7 +8,7 @@ import errno
 def mtime(path):
     try:
         return os.stat(path).st_mtime
-    except OSError as e:
+    except OSError, e:
         if e.errno == errno.ENOENT:
             return -1
         raise
diff -up mozilla-esr31/config/tests/unit-expandlibs.py.python3 mozilla-esr31/config/tests/unit-expandlibs.py
--- mozilla-esr31/config/tests/unit-expandlibs.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/tests/unit-expandlibs.py	2014-09-05 15:26:14.007680694 +0200
@@ -161,11 +161,15 @@ class TestExpandInit(TestCaseWithTmpDir)
         self.libx_files = [self.tmpfile('libx', Obj(f)) for f in ['g', 'h', 'i']]
         self.liby_files = [self.tmpfile('liby', Obj(f)) for f in ['j', 'k', 'l']] + [self.tmpfile('liby', Lib('z'))]
         self.touch(self.libx_files + self.liby_files)
-        with open(self.tmpfile('libx', Lib('x') + config.LIBS_DESC_SUFFIX), 'w') as f:
+        f = open(self.tmpfile('libx', Lib('x') + config.LIBS_DESC_SUFFIX), 'w')
+        if 1:
             f.write(str(generate(self.libx_files)))
-        with open(self.tmpfile('liby', Lib('y') + config.LIBS_DESC_SUFFIX), 'w') as f:
+        f.close()
+        f = open(self.tmpfile('liby', Lib('y') + config.LIBS_DESC_SUFFIX), 'w')
+        if 1:
             f.write(str(generate(self.liby_files + [self.tmpfile('libx', Lib('x'))])))
 
+        f.close()
         # Create various objects and libraries 
         self.arg_files = [self.tmpfile(f) for f in [Lib('a'), Obj('b'), Obj('c'), Lib('d'), Obj('e')]]
         # We always give library names (LIB_PREFIX/SUFFIX), even for
@@ -218,7 +222,8 @@ class TestExpandArgsMore(TestExpandInit)
     def test_makelist(self):
         '''Test grouping object files in lists'''
         # ExpandArgsMore does the same as ExpandArgs
-        with ExpandArgsMore(['foo', '-bar'] + self.arg_files + [self.tmpfile('liby', Lib('y'))]) as args:
+        args = ExpandArgsMore(['foo', '-bar'] + self.arg_files + [self.tmpfile('liby', Lib('y'))]).__enter__()
+        if 1:
             self.assertRelEqual(args, ['foo', '-bar'] + self.files + self.liby_files + self.libx_files) 
 
             # But also has an extra method replacing object files with a list
@@ -233,16 +238,21 @@ class TestExpandArgsMore(TestExpandInit)
                 self.assertNotEqual(args[3][0], '@')
                 filename = args[3]
                 content = ['INPUT("{0}")'.format(relativize(f)) for f in objs]
-                with open(filename, 'r') as f:
+                f = open(filename, 'r')
+                if 1:
                     self.assertEqual([l.strip() for l in f.readlines() if len(l.strip())], content)
+                f.close()
             elif config.EXPAND_LIBS_LIST_STYLE == "list":
                 self.assertEqual(args[3][0], '@')
                 filename = args[3][1:]
                 content = objs
-                with open(filename, 'r') as f:
+                f = open(filename, 'r')
+                if 1:
                     self.assertRelEqual([l.strip() for l in f.readlines() if len(l.strip())], content)
 
+                f.close()
             tmp = args.tmp
+        args.__exit__(0, 0, 0)
         # Check that all temporary files are properly removed
         self.assertEqual(True, all([not os.path.exists(f) for f in tmp]))
 
@@ -294,7 +304,8 @@ class TestExpandArgsMore(TestExpandInit)
 
         # ExpandArgsMore does the same as ExpandArgs
         self.touch([self.tmpfile('liby', Lib('y'))])
-        with ExpandArgsMore(['foo', '-bar'] + self.arg_files + [self.tmpfile('liby', Lib('y'))]) as args:
+        args = ExpandArgsMore(['foo', '-bar'] + self.arg_files + [self.tmpfile('liby', Lib('y'))]).__enter__()
+        if 1:
             self.assertRelEqual(args, ['foo', '-bar'] + self.files + [self.tmpfile('liby', Lib('y'))])
 
             # ExpandArgsMore also has an extra method extracting static libraries
@@ -314,6 +325,7 @@ class TestExpandArgsMore(TestExpandInit)
             self.assertRelEqual(args, ['foo', '-bar'] + extracted_args)
 
             tmp = args.tmp
+        args.__exit__(0, 0, 0)
         # Check that all temporary files are properly removed
         self.assertEqual(True, all([not os.path.exists(f) for f in tmp]))
 
diff -up mozilla-esr31/config/tests/unit-mozunit.py.python3 mozilla-esr31/config/tests/unit-mozunit.py
--- mozilla-esr31/config/tests/unit-mozunit.py.python3	2014-08-25 15:16:59.000000000 +0200
+++ mozilla-esr31/config/tests/unit-mozunit.py	2014-09-05 15:26:14.007680694 +0200
@@ -12,9 +12,11 @@ class TestMozUnit(unittest.TestCase):
     def test_mocked_open(self):
         # Create a temporary file on the file system.
         (fd, path) = mkstemp()
-        with os.fdopen(fd, 'w') as file:
+        file = os.fdopen(fd, 'w')
+        if 1:
             file.write('foobar');
 
+        file.close()
         self.assertFalse(os.path.exists('file1'))
         self.assertFalse(os.path.exists('file2'))
 
@@ -29,8 +31,10 @@ class TestMozUnit(unittest.TestCase):
             self.assertEqual(open('file2', 'r').read(), 'content2')
 
             # Check that overwriting these files alters their content.
-            with open('file1', 'w') as file:
+            file = open('file1', 'w')
+            if 1:
                 file.write('foo')
+            file.close()
             self.assertTrue(os.path.exists('file1'))
             self.assertEqual(open('file1', 'r').read(), 'foo')
 
@@ -42,8 +46,10 @@ class TestMozUnit(unittest.TestCase):
             self.assertEqual(open('file2', 'r').read(), 'bar')
 
             # Check that appending to a file does append
-            with open('file1', 'a') as file:
+            file = open('file1', 'a')
+            if 1:
                 file.write('bar')
+            file.close()
             self.assertEqual(open('file1', 'r').read(), 'foobar')
 
             self.assertFalse(os.path.exists('file3'))
@@ -53,8 +59,10 @@ class TestMozUnit(unittest.TestCase):
             self.assertFalse(os.path.exists('file3'))
 
             # Check that writing a new file does create the file.
-            with open('file3', 'w') as file:
+            file = open('file3', 'w')
+            if 1:
                 file.write('baz')
+            file.close()
             self.assertEqual(open('file3', 'r').read(), 'baz')
             self.assertTrue(os.path.exists('file3'))
 
@@ -63,17 +71,23 @@ class TestMozUnit(unittest.TestCase):
 
             # Check that overwriting a file existing on the file system
             # does modify its content.
-            with open(path, 'w') as file:
+            file = open(path, 'w')
+            if 1:
                 file.write('bazqux')
+            file.close()
             self.assertEqual(open(path, 'r').read(), 'bazqux')
 
-        with MockedOpen():
+        MockedOpen().__enter__()
+        if 1:
             # Check that appending to a file existing on the file system
             # does modify its content.
-            with open(path, 'a') as file:
+            file = open(path, 'a')
+            if 1:
                 file.write('bazqux')
+            file.close()
             self.assertEqual(open(path, 'r').read(), 'foobarbazqux')
 
+        MockedOpen().__exit__(0, 0, 0)
         # Check that the file was not actually modified on the file system.
         self.assertEqual(open(path, 'r').read(), 'foobar')
         os.remove(path)
diff -up mozilla-esr31/configure.python3 mozilla-esr31/configure
--- mozilla-esr31/configure.python3	2014-09-05 15:26:13.985680586 +0200
+++ mozilla-esr31/configure	2014-09-05 15:26:14.057680938 +0200
@@ -412,6 +412,8 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-raw           Enable support for RAW media"
 ac_help="$ac_help
+  --disable-ogg           Disable support for OGG media (Theora video and Vorbis audio)"
+ac_help="$ac_help
   --disable-opus          Disable support for Opus audio"
 ac_help="$ac_help
   --disable-webm          Disable support for WebM media (VP8 video and Vorbis audio)"
@@ -1203,7 +1205,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1207: checking host system type" >&5
+echo "configure:1209: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -1224,7 +1226,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1228: checking target system type" >&5
+echo "configure:1230: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -1242,7 +1244,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1246: checking build system type" >&5
+echo "configure:1248: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1317,7 +1319,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1321: checking for $ac_word" >&5
+echo "configure:1323: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1402,7 +1404,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1406: checking for $ac_word" >&5
+echo "configure:1408: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1512,7 +1514,7 @@ fi
 
 
 echo $ac_n "checking Python environment is Mozilla virtualenv""... $ac_c" 1>&6
-echo "configure:1516: checking Python environment is Mozilla virtualenv" >&5
+echo "configure:1518: checking Python environment is Mozilla virtualenv" >&5
 $PYTHON -c "import mozbuild.base"
 if test "$?" != 0; then
     { echo "configure: error: Python environment does not appear to be sane." 1>&2; echo "configure: error: Python environment does not appear to be sane." 1>&5; exit 1; }
@@ -1579,7 +1581,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1583: checking for $ac_word" >&5
+echo "configure:1585: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1634,7 +1636,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1638: checking for $ac_word" >&5
+echo "configure:1640: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1733,7 +1735,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1737: checking for $ac_word" >&5
+echo "configure:1739: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2058,7 +2060,7 @@ case "$target" in
 
     if test -z "$android_toolchain" ; then
         echo $ac_n "checking for android toolchain directory""... $ac_c" 1>&6
-echo "configure:2062: checking for android toolchain directory" >&5
+echo "configure:2064: checking for android toolchain directory" >&5
 
         kernel_name=`uname -s | tr "[:upper:]" "[:lower:]"`
 
@@ -2110,7 +2112,7 @@ echo "configure:2062: checking for andro
     NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-version=$android_version"
 
     echo $ac_n "checking for android platform directory""... $ac_c" 1>&6
-echo "configure:2114: checking for android platform directory" >&5
+echo "configure:2116: checking for android platform directory" >&5
 
     case "$target_cpu" in
     arm)
@@ -2208,7 +2210,7 @@ esac
         # Extract the first word of "objcopy", so it can be a program name with args.
 set dummy objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2212: checking for $ac_word" >&5
+echo "configure:2214: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2262,13 +2264,13 @@ _SAVE_CFLAGS="$CFLAGS"
 _SAVE_LDFLAGS="$LDFLAGS"
 
 echo $ac_n "checking for host c compiler""... $ac_c" 1>&6
-echo "configure:2266: checking for host c compiler" >&5
+echo "configure:2268: checking for host c compiler" >&5
 for ac_prog in cc gcc clang cl
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2272: checking for $ac_word" >&5
+echo "configure:2274: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2303,13 +2305,13 @@ if test -z "$HOST_CC"; then
 fi
 echo "$ac_t""$HOST_CC" 1>&6
 echo $ac_n "checking for host c++ compiler""... $ac_c" 1>&6
-echo "configure:2307: checking for host c++ compiler" >&5
+echo "configure:2309: checking for host c++ compiler" >&5
 for ac_prog in c++ g++ clang++ cl
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2313: checking for $ac_word" >&5
+echo "configure:2315: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2361,7 +2363,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2365: checking for $ac_word" >&5
+echo "configure:2367: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2396,7 +2398,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2400: checking for $ac_word" >&5
+echo "configure:2402: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2431,16 +2433,16 @@ CFLAGS="$HOST_CFLAGS"
 LDFLAGS="$HOST_LDFLAGS"
 
 echo $ac_n "checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2435: checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
+echo "configure:2437: checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2437 "configure"
+#line 2439 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:2444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_prog_hostcc_works=1 echo "$ac_t""yes" 1>&6
 else
@@ -2454,16 +2456,16 @@ rm -f conftest*
 CC="$HOST_CXX"
 CFLAGS="$HOST_CXXFLAGS"
 echo $ac_n "checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2458: checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works" >&5
+echo "configure:2460: checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2460 "configure"
+#line 2462 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:2467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_prog_hostcxx_works=1 echo "$ac_t""yes" 1>&6
 else
@@ -2483,7 +2485,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2487: checking for $ac_word" >&5
+echo "configure:2489: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2517,7 +2519,7 @@ unset ac_cv_prog_CC
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2521: checking for $ac_word" >&5
+echo "configure:2523: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2547,7 +2549,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2551: checking for $ac_word" >&5
+echo "configure:2553: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2598,7 +2600,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2602: checking for $ac_word" >&5
+echo "configure:2604: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2630,7 +2632,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2634: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2636: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2641,12 +2643,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2645 "configure"
+#line 2647 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2672,12 +2674,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&5; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2676: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2678: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2681: checking whether we are using GNU C" >&5
+echo "configure:2683: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2686,7 +2688,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2705,7 +2707,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2709: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2711: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2741,7 +2743,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2745: checking for $ac_word" >&5
+echo "configure:2747: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2777,7 +2779,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2781: checking for $ac_word" >&5
+echo "configure:2783: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2809,7 +2811,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2813: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:2815: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2820,12 +2822,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2824 "configure"
+#line 2826 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:2829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2851,12 +2853,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&5; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2855: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2857: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:2860: checking whether we are using GNU C++" >&5
+echo "configure:2862: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2865,7 +2867,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -2884,7 +2886,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:2888: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:2890: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2925,7 +2927,7 @@ for ac_declaration in \
    'void exit (int);'
 do
   cat > conftest.$ac_ext <<EOF
-#line 2929 "configure"
+#line 2931 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -2933,7 +2935,7 @@ int main() {
 exit (42);
 ; return 0; }
 EOF
-if { (eval echo configure:2937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -2943,14 +2945,14 @@ else
 fi
 rm -f conftest*
   cat > conftest.$ac_ext <<EOF
-#line 2947 "configure"
+#line 2949 "configure"
 #include "confdefs.h"
 $ac_declaration
 int main() {
 exit (42);
 ; return 0; }
 EOF
-if { (eval echo configure:2954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   break
 else
@@ -2972,7 +2974,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2976: checking for $ac_word" >&5
+echo "configure:2978: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3007,7 +3009,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3011: checking for $ac_word" >&5
+echo "configure:3013: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3042,7 +3044,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3046: checking for $ac_word" >&5
+echo "configure:3048: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3096,7 +3098,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3100: checking for $ac_word" >&5
+echo "configure:3102: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3131,7 +3133,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3135: checking for $ac_word" >&5
+echo "configure:3137: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3166,7 +3168,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3170: checking for $ac_word" >&5
+echo "configure:3172: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3211,7 +3213,7 @@ else
     # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3215: checking for $ac_word" >&5
+echo "configure:3217: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3241,7 +3243,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3245: checking for $ac_word" >&5
+echo "configure:3247: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3292,7 +3294,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3296: checking for $ac_word" >&5
+echo "configure:3298: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3324,7 +3326,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:3328: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:3330: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -3335,12 +3337,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 3339 "configure"
+#line 3341 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:3344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -3366,12 +3368,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&5; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:3370: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:3372: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:3375: checking whether we are using GNU C" >&5
+echo "configure:3377: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3380,7 +3382,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -3399,7 +3401,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:3403: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:3405: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3440,7 +3442,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3444: checking for $ac_word" >&5
+echo "configure:3446: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3472,7 +3474,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:3476: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:3478: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -3483,12 +3485,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 3487 "configure"
+#line 3489 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:3492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -3514,12 +3516,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&5; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:3518: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:3520: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:3523: checking whether we are using GNU C++" >&5
+echo "configure:3525: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3528,7 +3530,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:3532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:3534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -3547,7 +3549,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:3551: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:3553: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3588,7 +3590,7 @@ for ac_declaration in \
    'void exit (int);'
 do
   cat > conftest.$ac_ext <<EOF
-#line 3592 "configure"
+#line 3594 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -3596,7 +3598,7 @@ int main() {
 exit (42);
 ; return 0; }
 EOF
-if { (eval echo configure:3600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -3606,14 +3608,14 @@ else
 fi
 rm -f conftest*
   cat > conftest.$ac_ext <<EOF
-#line 3610 "configure"
+#line 3612 "configure"
 #include "confdefs.h"
 $ac_declaration
 int main() {
 exit (42);
 ; return 0; }
 EOF
-if { (eval echo configure:3617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   break
 else
@@ -3632,7 +3634,7 @@ fi
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3636: checking for $ac_word" >&5
+echo "configure:3638: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3664,7 +3666,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3668: checking for $ac_word" >&5
+echo "configure:3670: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3718,7 +3720,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3722: checking for $ac_word" >&5
+echo "configure:3724: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3753,7 +3755,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3757: checking for $ac_word" >&5
+echo "configure:3759: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3788,7 +3790,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3792: checking for $ac_word" >&5
+echo "configure:3794: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3823,7 +3825,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3827: checking for $ac_word" >&5
+echo "configure:3829: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4052,7 +4054,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4056: checking for $ac_word" >&5
+echo "configure:4058: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MIDL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4094,14 +4096,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext
 cross_compiling=$ac_cv_prog_cc_cross
 
         cat > conftest.$ac_ext <<EOF
-#line 4098 "configure"
+#line 4100 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
  printf("Hello World\n"); 
 ; return 0; }
 EOF
-if { (eval echo configure:4105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -4119,14 +4121,14 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
 
         cat > conftest.$ac_ext <<EOF
-#line 4123 "configure"
+#line 4125 "configure"
 #include "confdefs.h"
 #include <new.h>
 int main() {
  unsigned *test = new unsigned(42); 
 ; return 0; }
 EOF
-if { (eval echo configure:4130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -4208,13 +4210,13 @@ EOF
 
                 if test -n "$MOZ_METRO"; then
           echo $ac_n "checking for makepri""... $ac_c" 1>&6
-echo "configure:4212: checking for makepri" >&5
+echo "configure:4214: checking for makepri" >&5
           for ac_prog in makepri
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4218: checking for $ac_word" >&5
+echo "configure:4220: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MAKEPRI'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4288,7 +4290,7 @@ test -n "$MAKEPRI" || MAKEPRI=""""
         unset _MSVC_VER_FILTER
 
         echo $ac_n "checking for std::_Throw""... $ac_c" 1>&6
-echo "configure:4292: checking for std::_Throw" >&5
+echo "configure:4294: checking for std::_Throw" >&5
 if eval "test \"`echo '$''{'ac_cv_have_std__Throw'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4304,14 +4306,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
                 _SAVE_CXXFLAGS="$CXXFLAGS"
                 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
                 cat > conftest.$ac_ext <<EOF
-#line 4308 "configure"
+#line 4310 "configure"
 #include "confdefs.h"
 #include <exception>
 int main() {
 std::_Throw(std::exception()); return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_std__Throw="yes"
 else
@@ -4336,7 +4338,7 @@ echo "$ac_t""$ac_cv_have_std__Throw" 1>&
 
         if test "$ac_cv_have_std__Throw" = "yes"; then
             echo $ac_n "checking for |class __declspec(dllimport) exception| bug""... $ac_c" 1>&6
-echo "configure:4340: checking for |class __declspec(dllimport) exception| bug" >&5
+echo "configure:4342: checking for |class __declspec(dllimport) exception| bug" >&5
 if eval "test \"`echo '$''{'ac_cv_have_dllimport_exception_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4352,14 +4354,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
                     _SAVE_CXXFLAGS="$CXXFLAGS"
                     CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
                     cat > conftest.$ac_ext <<EOF
-#line 4356 "configure"
+#line 4358 "configure"
 #include "confdefs.h"
 #include <vector>
 int main() {
 std::vector<int> v; return v.at(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_have_dllimport_exception_bug="no"
 else
@@ -4394,7 +4396,7 @@ EOF
             fi
         else
             echo $ac_n "checking for overridable _RAISE""... $ac_c" 1>&6
-echo "configure:4398: checking for overridable _RAISE" >&5
+echo "configure:4400: checking for overridable _RAISE" >&5
 if eval "test \"`echo '$''{'ac_cv_have__RAISE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4410,7 +4412,7 @@ cross_compiling=$ac_cv_prog_cxx_cross
                     _SAVE_CXXFLAGS="$CXXFLAGS"
                     CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
                     cat > conftest.$ac_ext <<EOF
-#line 4414 "configure"
+#line 4416 "configure"
 #include "confdefs.h"
 #include <xstddef>
                                     #undef _RAISE
@@ -4421,7 +4423,7 @@ int main() {
 std::vector<int> v; return v.at(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have__RAISE="no"
 else
@@ -4466,9 +4468,9 @@ EOF
         _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
         _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
         echo $ac_n "checking for w32api version >= $W32API_VERSION""... $ac_c" 1>&6
-echo "configure:4470: checking for w32api version >= $W32API_VERSION" >&5
+echo "configure:4472: checking for w32api version >= $W32API_VERSION" >&5
         cat > conftest.$ac_ext <<EOF
-#line 4472 "configure"
+#line 4474 "configure"
 #include "confdefs.h"
 #include <w32api.h>
 int main() {
@@ -4480,7 +4482,7 @@ int main() {
             
 ; return 0; }
 EOF
-if { (eval echo configure:4484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    res=yes 
 else
@@ -4496,7 +4498,7 @@ rm -f conftest*
         fi
         # Check windres version
         echo $ac_n "checking for windres version >= $WINDRES_VERSION""... $ac_c" 1>&6
-echo "configure:4500: checking for windres version >= $WINDRES_VERSION" >&5
+echo "configure:4502: checking for windres version >= $WINDRES_VERSION" >&5
         _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
         echo "$ac_t""$_WINDRES_VERSION" 1>&6
         _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
@@ -4520,7 +4522,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4524: checking for $ac_word" >&5
+echo "configure:4526: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MIDL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4580,12 +4582,12 @@ EOF
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4584: checking for $ac_hdr" >&5
+echo "configure:4586: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 4589 "configure"
+#line 4591 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -4593,7 +4595,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -4624,7 +4626,7 @@ EOF
 
   if test "$ac_cv_header_winsdkver_h" = "yes"; then
                               echo $ac_n "checking for highest Windows version supported by this SDK""... $ac_c" 1>&6
-echo "configure:4628: checking for highest Windows version supported by this SDK" >&5
+echo "configure:4630: checking for highest Windows version supported by this SDK" >&5
 if eval "test \"`echo '$''{'ac_cv_winsdk_maxver'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4679,7 +4681,7 @@ EOF
     # If the maximum version supported by this SDK is lower than the target
     # version, error out
     echo $ac_n "checking for Windows SDK being recent enough""... $ac_c" 1>&6
-echo "configure:4683: checking for Windows SDK being recent enough" >&5
+echo "configure:4685: checking for Windows SDK being recent enough" >&5
     if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
         echo "$ac_t"""yes"" 1>&6
     else
@@ -4714,7 +4716,7 @@ EOF
 esac
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:4718: checking how to run the C preprocessor" >&5
+echo "configure:4720: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -4729,13 +4731,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 4733 "configure"
+#line 4735 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -4746,13 +4748,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 4750 "configure"
+#line 4752 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -4763,13 +4765,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 4767 "configure"
+#line 4769 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -4794,7 +4796,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:4798: checking how to run the C++ preprocessor" >&5
+echo "configure:4800: checking how to run the C++ preprocessor" >&5
 if test -z "$CXXCPP"; then
 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4807,12 +4809,12 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
   CXXCPP="${CXX-g++} -E"
   cat > conftest.$ac_ext <<EOF
-#line 4811 "configure"
+#line 4813 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -4896,7 +4898,7 @@ fi # COMPILE_ENVIRONMENT
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:4900: checking for a BSD compatible install" >&5
+echo "configure:4902: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4949,7 +4951,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:4953: checking whether ln -s works" >&5
+echo "configure:4955: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4972,7 +4974,7 @@ fi
 
 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
 echo $ac_n "checking for minimum required perl version >= $PERL_VERSION""... $ac_c" 1>&6
-echo "configure:4976: checking for minimum required perl version >= $PERL_VERSION" >&5
+echo "configure:4978: checking for minimum required perl version >= $PERL_VERSION" >&5
 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
 _perl_res=$?
 echo "$ac_t""$_perl_version" 1>&6
@@ -4983,7 +4985,7 @@ fi
 fi
 
 echo $ac_n "checking for full perl installation""... $ac_c" 1>&6
-echo "configure:4987: checking for full perl installation" >&5
+echo "configure:4989: checking for full perl installation" >&5
 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
 _perl_res=$?
 if test "$_perl_res" != 0; then
@@ -5001,7 +5003,7 @@ fi
  # Extract the first word of "doxygen", so it can be a program name with args.
 set dummy doxygen; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5005: checking for $ac_word" >&5
+echo "configure:5007: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5050,7 +5052,7 @@ fi
  # Extract the first word of "autoconf", so it can be a program name with args.
 set dummy autoconf; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5054: checking for $ac_word" >&5
+echo "configure:5056: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AUTOCONF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5101,7 +5103,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5105: checking for $ac_word" >&5
+echo "configure:5107: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5157,7 +5159,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5161: checking for $ac_word" >&5
+echo "configure:5163: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5211,7 +5213,7 @@ fi
  # Extract the first word of "xargs", so it can be a program name with args.
 set dummy xargs; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5215: checking for $ac_word" >&5
+echo "configure:5217: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XARGS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5263,7 +5265,7 @@ fi
  # Extract the first word of "rpmbuild", so it can be a program name with args.
 set dummy rpmbuild; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5267: checking for $ac_word" >&5
+echo "configure:5269: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RPMBUILD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5406,7 +5408,7 @@ tools are selected during the Xcode/Deve
 
   
   echo $ac_n "checking for valid compiler/Mac OS X SDK combination""... $ac_c" 1>&6
-echo "configure:5410: checking for valid compiler/Mac OS X SDK combination" >&5
+echo "configure:5412: checking for valid compiler/Mac OS X SDK combination" >&5
   ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -5415,14 +5417,14 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
 
   cat > conftest.$ac_ext <<EOF
-#line 5419 "configure"
+#line 5421 "configure"
 #include "confdefs.h"
 #include <new>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   result=yes
 else
@@ -5449,7 +5451,7 @@ fi
 fi # COMPILE_ENVIRONMENT
 
 echo $ac_n "checking compiler version""... $ac_c" 1>&6
-echo "configure:5453: checking compiler version" >&5
+echo "configure:5455: checking compiler version" >&5
 # Just print it so it shows up in the logs.
 cc_version=$($CC --version)
 echo "$ac_t""$cc_version" 1>&6
@@ -5467,7 +5469,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5471: checking for $ac_word" >&5
+echo "configure:5473: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5523,7 +5525,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5527: checking for $ac_word" >&5
+echo "configure:5529: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5590,7 +5592,7 @@ if test "$COMPILE_ENVIRONMENT"; then
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:5594: checking for X" >&5
+echo "configure:5596: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -5652,12 +5654,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 5656 "configure"
+#line 5658 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5726,14 +5728,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5730 "configure"
+#line 5732 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:5737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -5842,17 +5844,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:5846: checking whether -R must be followed by a space" >&5
+echo "configure:5848: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 5849 "configure"
+#line 5851 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -5868,14 +5870,14 @@ rm -f conftest*
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 5872 "configure"
+#line 5874 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -5907,7 +5909,7 @@ rm -f conftest*
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:5911: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:5913: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5915,7 +5917,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5919 "configure"
+#line 5921 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5926,7 +5928,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5948,7 +5950,7 @@ fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:5952: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:5954: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5956,7 +5958,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5960 "configure"
+#line 5962 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5967,7 +5969,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5996,12 +5998,12 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6000: checking for gethostbyname" >&5
+echo "configure:6002: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6005 "configure"
+#line 6007 "configure"
 #define gethostbyname innocuous_gethostbyname
 #include "confdefs.h"
 #undef gethostbyname
@@ -6028,7 +6030,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -6049,7 +6051,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6053: checking for gethostbyname in -lnsl" >&5
+echo "configure:6055: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6057,7 +6059,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6061 "configure"
+#line 6063 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6068,7 +6070,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6098,12 +6100,12 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6102: checking for connect" >&5
+echo "configure:6104: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6107 "configure"
+#line 6109 "configure"
 #define connect innocuous_connect
 #include "confdefs.h"
 #undef connect
@@ -6130,7 +6132,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -6151,7 +6153,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6155: checking for connect in -lsocket" >&5
+echo "configure:6157: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6159,7 +6161,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6163 "configure"
+#line 6165 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6170,7 +6172,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:6174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6194,12 +6196,12 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:6198: checking for remove" >&5
+echo "configure:6200: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6203 "configure"
+#line 6205 "configure"
 #define remove innocuous_remove
 #include "confdefs.h"
 #undef remove
@@ -6226,7 +6228,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -6247,7 +6249,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:6251: checking for remove in -lposix" >&5
+echo "configure:6253: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6255,7 +6257,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6259 "configure"
+#line 6261 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6266,7 +6268,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:6270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6290,12 +6292,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:6294: checking for shmat" >&5
+echo "configure:6296: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6299 "configure"
+#line 6301 "configure"
 #define shmat innocuous_shmat
 #include "confdefs.h"
 #undef shmat
@@ -6322,7 +6324,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -6343,7 +6345,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:6347: checking for shmat in -lipc" >&5
+echo "configure:6349: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6351,7 +6353,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6355 "configure"
+#line 6357 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6362,7 +6364,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:6366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6395,7 +6397,7 @@ fi
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:6399: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:6401: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6403,7 +6405,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6407 "configure"
+#line 6409 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6414,7 +6416,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6824,14 +6826,14 @@ no)
     _SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$arch_flag"
     cat > conftest.$ac_ext <<EOF
-#line 6828 "configure"
+#line 6830 "configure"
 #include "confdefs.h"
 
 int main() {
 return sizeof(__thumb2__);
 ; return 0; }
 EOF
-if { (eval echo configure:6835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_THUMB2=1
 else
@@ -6914,16 +6916,16 @@ if test -n "$align_flag"; then
   _SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $align_flag"
   echo $ac_n "checking whether alignment flag ($align_flag) is supported""... $ac_c" 1>&6
-echo "configure:6918: checking whether alignment flag ($align_flag) is supported" >&5
+echo "configure:6920: checking whether alignment flag ($align_flag) is supported" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6920 "configure"
+#line 6922 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -6940,16 +6942,16 @@ if test -n "$all_flags"; then
     _SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$all_flags"
     echo $ac_n "checking whether the chosen combination of compiler flags ($all_flags) works""... $ac_c" 1>&6
-echo "configure:6944: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
+echo "configure:6946: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
     cat > conftest.$ac_ext <<EOF
-#line 6946 "configure"
+#line 6948 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:6953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -6972,18 +6974,18 @@ fi
 
 if test "$CPU_ARCH" = "arm"; then
   echo $ac_n "checking for ARM SIMD support in compiler""... $ac_c" 1>&6
-echo "configure:6976: checking for ARM SIMD support in compiler" >&5
+echo "configure:6978: checking for ARM SIMD support in compiler" >&5
   # We try to link so that this also fails when
   # building with LTO.
   cat > conftest.$ac_ext <<EOF
-#line 6980 "configure"
+#line 6982 "configure"
 #include "confdefs.h"
 
 int main() {
 asm("uqadd8 r1, r1, r2");
 ; return 0; }
 EOF
-if { (eval echo configure:6987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   result="yes"
 else
@@ -7006,23 +7008,23 @@ EOF
   fi
 
   echo $ac_n "checking ARM version support in compiler""... $ac_c" 1>&6
-echo "configure:7010: checking ARM version support in compiler" >&5
+echo "configure:7012: checking ARM version support in compiler" >&5
     ARM_ARCH=`${CC-cc} ${CFLAGS} -dM -E - < /dev/null | sed -n 's/.*__ARM_ARCH_\([0-9][0-9]*\).*/\1/p'`
   echo "$ac_t"""$ARM_ARCH"" 1>&6
 
   echo $ac_n "checking for ARM NEON support in compiler""... $ac_c" 1>&6
-echo "configure:7015: checking for ARM NEON support in compiler" >&5
+echo "configure:7017: checking for ARM NEON support in compiler" >&5
   # We try to link so that this also fails when
   # building with LTO.
   cat > conftest.$ac_ext <<EOF
-#line 7019 "configure"
+#line 7021 "configure"
 #include "confdefs.h"
 
 int main() {
 asm(".fpu neon\n vadd.i8 d0, d0, d0");
 ; return 0; }
 EOF
-if { (eval echo configure:7026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   result="yes"
 else
@@ -7085,7 +7087,7 @@ configure_static_assert_macros='
 '
 
 echo $ac_n "checking that static assertion macros used in autoconf tests work""... $ac_c" 1>&6
-echo "configure:7089: checking that static assertion macros used in autoconf tests work" >&5
+echo "configure:7091: checking that static assertion macros used in autoconf tests work" >&5
 if eval "test \"`echo '$''{'ac_cv_static_assertion_macros_work'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7099,14 +7101,14 @@ cross_compiling=$ac_cv_prog_cc_cross
 
   ac_cv_static_assertion_macros_work="yes"
   cat > conftest.$ac_ext <<EOF
-#line 7103 "configure"
+#line 7105 "configure"
 #include "confdefs.h"
 $configure_static_assert_macros
 int main() {
 CONFIGURE_STATIC_ASSERT(1)
 ; return 0; }
 EOF
-if { (eval echo configure:7110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -7116,14 +7118,14 @@ else
 fi
 rm -f conftest*
   cat > conftest.$ac_ext <<EOF
-#line 7120 "configure"
+#line 7122 "configure"
 #include "confdefs.h"
 $configure_static_assert_macros
 int main() {
 CONFIGURE_STATIC_ASSERT(0)
 ; return 0; }
 EOF
-if { (eval echo configure:7127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_static_assertion_macros_work="no"
 else
@@ -7139,14 +7141,14 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
 
   cat > conftest.$ac_ext <<EOF
-#line 7143 "configure"
+#line 7145 "configure"
 #include "confdefs.h"
 $configure_static_assert_macros
 int main() {
 CONFIGURE_STATIC_ASSERT(1)
 ; return 0; }
 EOF
-if { (eval echo configure:7150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -7156,14 +7158,14 @@ else
 fi
 rm -f conftest*
   cat > conftest.$ac_ext <<EOF
-#line 7160 "configure"
+#line 7162 "configure"
 #include "confdefs.h"
 $configure_static_assert_macros
 int main() {
 CONFIGURE_STATIC_ASSERT(0)
 ; return 0; }
 EOF
-if { (eval echo configure:7167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_static_assertion_macros_work="no"
 else
@@ -7269,7 +7271,7 @@ EOF
      # Extract the first word of "llvm-symbolizer", so it can be a program name with args.
 set dummy llvm-symbolizer; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7273: checking for $ac_word" >&5
+echo "configure:7275: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LLVM_SYMBOLIZER'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7358,18 +7360,18 @@ if test "$GNU_CC"; then
     DSO_PIC_CFLAGS='-fPIC'
     ASFLAGS="$ASFLAGS -fPIC"
     echo $ac_n "checking for --noexecstack option to as""... $ac_c" 1>&6
-echo "configure:7362: checking for --noexecstack option to as" >&5
+echo "configure:7364: checking for --noexecstack option to as" >&5
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -Wa,--noexecstack"
     cat > conftest.$ac_ext <<EOF
-#line 7366 "configure"
+#line 7368 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                      ASFLAGS="$ASFLAGS -Wa,--noexecstack"
@@ -7382,18 +7384,18 @@ fi
 rm -f conftest*
     CFLAGS=$_SAVE_CFLAGS
     echo $ac_n "checking for -z noexecstack option to ld""... $ac_c" 1>&6
-echo "configure:7386: checking for -z noexecstack option to ld" >&5
+echo "configure:7388: checking for -z noexecstack option to ld" >&5
     _SAVE_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
     cat > conftest.$ac_ext <<EOF
-#line 7390 "configure"
+#line 7392 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -7406,18 +7408,18 @@ fi
 rm -f conftest*
 
     echo $ac_n "checking for -z text option to ld""... $ac_c" 1>&6
-echo "configure:7410: checking for -z text option to ld" >&5
+echo "configure:7412: checking for -z text option to ld" >&5
     _SAVE_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -Wl,-z,text"
     cat > conftest.$ac_ext <<EOF
-#line 7414 "configure"
+#line 7416 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                   NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,text"
@@ -7431,18 +7433,18 @@ fi
 rm -f conftest*
 
     echo $ac_n "checking for --build-id option to ld""... $ac_c" 1>&6
-echo "configure:7435: checking for --build-id option to ld" >&5
+echo "configure:7437: checking for --build-id option to ld" >&5
     _SAVE_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -Wl,--build-id"
     cat > conftest.$ac_ext <<EOF
-#line 7439 "configure"
+#line 7441 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                   NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,--build-id"
@@ -7456,19 +7458,19 @@ fi
 rm -f conftest*
 
     echo $ac_n "checking for --ignore-unresolved-symbol option to ld""... $ac_c" 1>&6
-echo "configure:7460: checking for --ignore-unresolved-symbol option to ld" >&5
+echo "configure:7462: checking for --ignore-unresolved-symbol option to ld" >&5
     HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
     _SAVE_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
     cat > conftest.$ac_ext <<EOF
-#line 7465 "configure"
+#line 7467 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                   HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1
@@ -7483,19 +7485,19 @@ rm -f conftest*
 
     # Check for -mssse3 on $CC
     echo $ac_n "checking if toolchain supports -mssse3 option""... $ac_c" 1>&6
-echo "configure:7487: checking if toolchain supports -mssse3 option" >&5
+echo "configure:7489: checking if toolchain supports -mssse3 option" >&5
     HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -mssse3"
     cat > conftest.$ac_ext <<EOF
-#line 7492 "configure"
+#line 7494 "configure"
 #include "confdefs.h"
 asm ("pmaddubsw %xmm2,%xmm3");
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                      HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
@@ -7510,19 +7512,19 @@ rm -f conftest*
 
     # Check for -msse4.1 on $CC
     echo $ac_n "checking if toolchain supports -msse4.1 option""... $ac_c" 1>&6
-echo "configure:7514: checking if toolchain supports -msse4.1 option" >&5
+echo "configure:7516: checking if toolchain supports -msse4.1 option" >&5
     HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -msse4.1"
     cat > conftest.$ac_ext <<EOF
-#line 7519 "configure"
+#line 7521 "configure"
 #include "confdefs.h"
 asm ("pmulld %xmm6,%xmm0");
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                      HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1
@@ -7538,16 +7540,16 @@ rm -f conftest*
     case "${CPU_ARCH}" in
     x86 | x86_64)
       echo $ac_n "checking for x86 AVX2 asm support in compiler""... $ac_c" 1>&6
-echo "configure:7542: checking for x86 AVX2 asm support in compiler" >&5
+echo "configure:7544: checking for x86 AVX2 asm support in compiler" >&5
       cat > conftest.$ac_ext <<EOF
-#line 7544 "configure"
+#line 7546 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile ("vpermq      \$0xd8,%ymm0,%ymm0 \n");
 ; return 0; }
 EOF
-if { (eval echo configure:7551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   result="yes"
 else
@@ -7606,7 +7608,7 @@ EOF
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
     
     echo $ac_n "checking whether the C compiler supports -Werror=return-type""... $ac_c" 1>&6
-echo "configure:7610: checking whether the C compiler supports -Werror=return-type" >&5
+echo "configure:7612: checking whether the C compiler supports -Werror=return-type" >&5
 if eval "test \"`echo '$''{'ac_c_has_werror_return_type'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7622,14 +7624,14 @@ cross_compiling=$ac_cv_prog_cc_cross
             _SAVE_CFLAGS="$CFLAGS"
             CFLAGS="$CFLAGS -Werror -Werror=return-type"
             cat > conftest.$ac_ext <<EOF
-#line 7626 "configure"
+#line 7628 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:7633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_c_has_werror_return_type="yes"
 else
@@ -7657,7 +7659,7 @@ echo "$ac_t""$ac_c_has_werror_return_typ
 
     
     echo $ac_n "checking whether the C compiler supports -Werror=int-to-pointer-cast""... $ac_c" 1>&6
-echo "configure:7661: checking whether the C compiler supports -Werror=int-to-pointer-cast" >&5
+echo "configure:7663: checking whether the C compiler supports -Werror=int-to-pointer-cast" >&5
 if eval "test \"`echo '$''{'ac_c_has_werror_int_to_pointer_cast'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7673,14 +7675,14 @@ cross_compiling=$ac_cv_prog_cc_cross
             _SAVE_CFLAGS="$CFLAGS"
             CFLAGS="$CFLAGS -Werror -Werror=int-to-pointer-cast"
             cat > conftest.$ac_ext <<EOF
-#line 7677 "configure"
+#line 7679 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:7684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_c_has_werror_int_to_pointer_cast="yes"
 else
@@ -7708,7 +7710,7 @@ echo "$ac_t""$ac_c_has_werror_int_to_poi
 
     
     echo $ac_n "checking whether the C compiler supports -Wtype-limits""... $ac_c" 1>&6
-echo "configure:7712: checking whether the C compiler supports -Wtype-limits" >&5
+echo "configure:7714: checking whether the C compiler supports -Wtype-limits" >&5
 if eval "test \"`echo '$''{'ac_c_has_wtype_limits'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7724,14 +7726,14 @@ cross_compiling=$ac_cv_prog_cc_cross
             _SAVE_CFLAGS="$CFLAGS"
             CFLAGS="$CFLAGS -Werror -Wtype-limits"
             cat > conftest.$ac_ext <<EOF
-#line 7728 "configure"
+#line 7730 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:7735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_c_has_wtype_limits="yes"
 else
@@ -7759,7 +7761,7 @@ echo "$ac_t""$ac_c_has_wtype_limits" 1>&
 
     
     echo $ac_n "checking whether the C compiler supports -Wempty-body""... $ac_c" 1>&6
-echo "configure:7763: checking whether the C compiler supports -Wempty-body" >&5
+echo "configure:7765: checking whether the C compiler supports -Wempty-body" >&5
 if eval "test \"`echo '$''{'ac_c_has_wempty_body'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7775,14 +7777,14 @@ cross_compiling=$ac_cv_prog_cc_cross
             _SAVE_CFLAGS="$CFLAGS"
             CFLAGS="$CFLAGS -Werror -Wempty-body"
             cat > conftest.$ac_ext <<EOF
-#line 7779 "configure"
+#line 7781 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:7786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_c_has_wempty_body="yes"
 else
@@ -7810,7 +7812,7 @@ echo "$ac_t""$ac_c_has_wempty_body" 1>&6
 
     
     echo $ac_n "checking whether the C compiler supports -Wsign-compare""... $ac_c" 1>&6
-echo "configure:7814: checking whether the C compiler supports -Wsign-compare" >&5
+echo "configure:7816: checking whether the C compiler supports -Wsign-compare" >&5
 if eval "test \"`echo '$''{'ac_c_has_sign_compare'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7826,14 +7828,14 @@ cross_compiling=$ac_cv_prog_cc_cross
             _SAVE_CFLAGS="$CFLAGS"
             CFLAGS="$CFLAGS -Werror -Wsign-compare"
             cat > conftest.$ac_ext <<EOF
-#line 7830 "configure"
+#line 7832 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:7837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_c_has_sign_compare="yes"
 else
@@ -7922,7 +7924,7 @@ if test "$GNU_CXX"; then
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
     
     echo $ac_n "checking whether the C++ compiler supports -Werror=return-type""... $ac_c" 1>&6
-echo "configure:7926: checking whether the C++ compiler supports -Werror=return-type" >&5
+echo "configure:7928: checking whether the C++ compiler supports -Werror=return-type" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_werror_return_type'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7938,14 +7940,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Werror=return-type"
             cat > conftest.$ac_ext <<EOF
-#line 7942 "configure"
+#line 7944 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:7949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_werror_return_type="yes"
 else
@@ -7973,7 +7975,7 @@ echo "$ac_t""$ac_cxx_has_werror_return_t
 
     
     echo $ac_n "checking whether the C++ compiler supports -Werror=int-to-pointer-cast""... $ac_c" 1>&6
-echo "configure:7977: checking whether the C++ compiler supports -Werror=int-to-pointer-cast" >&5
+echo "configure:7979: checking whether the C++ compiler supports -Werror=int-to-pointer-cast" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_werror_int_to_pointer_cast'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7989,14 +7991,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Werror=int-to-pointer-cast"
             cat > conftest.$ac_ext <<EOF
-#line 7993 "configure"
+#line 7995 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_werror_int_to_pointer_cast="yes"
 else
@@ -8024,7 +8026,7 @@ echo "$ac_t""$ac_cxx_has_werror_int_to_p
 
     
     echo $ac_n "checking whether the C++ compiler supports -Wtype-limits""... $ac_c" 1>&6
-echo "configure:8028: checking whether the C++ compiler supports -Wtype-limits" >&5
+echo "configure:8030: checking whether the C++ compiler supports -Wtype-limits" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_wtype_limits'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8040,14 +8042,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Wtype-limits"
             cat > conftest.$ac_ext <<EOF
-#line 8044 "configure"
+#line 8046 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_wtype_limits="yes"
 else
@@ -8075,7 +8077,7 @@ echo "$ac_t""$ac_cxx_has_wtype_limits" 1
 
     
     echo $ac_n "checking whether the C++ compiler supports -Wempty-body""... $ac_c" 1>&6
-echo "configure:8079: checking whether the C++ compiler supports -Wempty-body" >&5
+echo "configure:8081: checking whether the C++ compiler supports -Wempty-body" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_wempty_body'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8091,14 +8093,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Wempty-body"
             cat > conftest.$ac_ext <<EOF
-#line 8095 "configure"
+#line 8097 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_wempty_body="yes"
 else
@@ -8126,7 +8128,7 @@ echo "$ac_t""$ac_cxx_has_wempty_body" 1>
 
     
     echo $ac_n "checking whether the C++ compiler supports -Wsign-compare""... $ac_c" 1>&6
-echo "configure:8130: checking whether the C++ compiler supports -Wsign-compare" >&5
+echo "configure:8132: checking whether the C++ compiler supports -Wsign-compare" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_sign_compare'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8142,14 +8144,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Wsign-compare"
             cat > conftest.$ac_ext <<EOF
-#line 8146 "configure"
+#line 8148 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_sign_compare="yes"
 else
@@ -8184,7 +8186,7 @@ echo "$ac_t""$ac_cxx_has_sign_compare" 1
     #
     
     echo $ac_n "checking whether the C++ compiler supports -Wno-invalid-offsetof""... $ac_c" 1>&6
-echo "configure:8188: checking whether the C++ compiler supports -Wno-invalid-offsetof" >&5
+echo "configure:8190: checking whether the C++ compiler supports -Wno-invalid-offsetof" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_wno_invalid_offsetof'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8200,14 +8202,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Winvalid-offsetof"
             cat > conftest.$ac_ext <<EOF
-#line 8204 "configure"
+#line 8206 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_wno_invalid_offsetof="yes"
 else
@@ -8235,7 +8237,7 @@ echo "$ac_t""$ac_cxx_has_wno_invalid_off
 
     
     echo $ac_n "checking whether the C++ compiler supports -Wno-inline-new-delete""... $ac_c" 1>&6
-echo "configure:8239: checking whether the C++ compiler supports -Wno-inline-new-delete" >&5
+echo "configure:8241: checking whether the C++ compiler supports -Wno-inline-new-delete" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_wno_inline_new_delete'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8251,14 +8253,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Winline-new-delete"
             cat > conftest.$ac_ext <<EOF
-#line 8255 "configure"
+#line 8257 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_wno_inline_new_delete="yes"
 else
@@ -8310,7 +8312,7 @@ echo "$ac_t""$ac_cxx_has_wno_inline_new_
         _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
         
     echo $ac_n "checking whether the C++ compiler supports -Wno-extended-offsetof""... $ac_c" 1>&6
-echo "configure:8314: checking whether the C++ compiler supports -Wno-extended-offsetof" >&5
+echo "configure:8316: checking whether the C++ compiler supports -Wno-extended-offsetof" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_wno_extended_offsetof'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8326,14 +8328,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Wextended-offsetof"
             cat > conftest.$ac_ext <<EOF
-#line 8330 "configure"
+#line 8332 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:8337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_wno_extended_offsetof="yes"
 else
@@ -8371,7 +8373,7 @@ MKSHLIB_UNFORCE_ALL=
 if test "$COMPILE_ENVIRONMENT"; then
 if test "$GNU_CC"; then
   echo $ac_n "checking whether ld has archive extraction flags""... $ac_c" 1>&6
-echo "configure:8375: checking whether ld has archive extraction flags" >&5
+echo "configure:8377: checking whether ld has archive extraction flags" >&5
   if eval "test \"`echo '$''{'ac_cv_mkshlib_force_and_unforce'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8388,14 +8390,14 @@ LOOP_INPUT
       LDFLAGS=$force
       LIBS=$unforce
       cat > conftest.$ac_ext <<EOF
-#line 8392 "configure"
+#line 8394 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_mkshlib_force_and_unforce=$line; break
 else
@@ -8430,16 +8432,16 @@ ac_link='${CC-cc} -o conftest${ac_exeext
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking for 64-bit OS""... $ac_c" 1>&6
-echo "configure:8434: checking for 64-bit OS" >&5
+echo "configure:8436: checking for 64-bit OS" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8436 "configure"
+#line 8438 "configure"
 #include "confdefs.h"
 $configure_static_assert_macros
 int main() {
 CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)
 ; return 0; }
 EOF
-if { (eval echo configure:8443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   result="yes"
 else
@@ -8529,12 +8531,12 @@ fi
 if test -n "$MOZ_VALGRIND"; then
        ac_safe=`echo "valgrind/valgrind.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for valgrind/valgrind.h""... $ac_c" 1>&6
-echo "configure:8533: checking for valgrind/valgrind.h" >&5
+echo "configure:8535: checking for valgrind/valgrind.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 8538 "configure"
+#line 8540 "configure"
 #include "confdefs.h"
 
 #include <valgrind/valgrind.h>
@@ -8542,7 +8544,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -8784,7 +8786,7 @@ case "$host" in
 esac
 
 echo $ac_n "checking for custom <inttypes.h> implementation""... $ac_c" 1>&6
-echo "configure:8788: checking for custom <inttypes.h> implementation" >&5
+echo "configure:8790: checking for custom <inttypes.h> implementation" >&5
 if test "$MOZ_CUSTOM_INTTYPES_H"; then
   cat >> confdefs.pytmp <<EOF
     (''' MOZ_CUSTOM_INTTYPES_H ''', r''' "$MOZ_CUSTOM_INTTYPES_H" ''')
@@ -8885,9 +8887,9 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
 
             echo $ac_n "checking for IBM XLC/C++ compiler version >= 9.0.0.7""... $ac_c" 1>&6
-echo "configure:8889: checking for IBM XLC/C++ compiler version >= 9.0.0.7" >&5
+echo "configure:8891: checking for IBM XLC/C++ compiler version >= 9.0.0.7" >&5
             cat > conftest.$ac_ext <<EOF
-#line 8891 "configure"
+#line 8893 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -8896,7 +8898,7 @@ int main() {
                  #endif
 ; return 0; }
 EOF
-if { (eval echo configure:8900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   _BAD_COMPILER=
 else
@@ -8934,12 +8936,12 @@ cross_compiling=$ac_cv_prog_cc_cross
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8938: checking for $ac_hdr" >&5
+echo "configure:8940: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 8943 "configure"
+#line 8945 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -8947,7 +8949,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -8999,12 +9001,12 @@ EOF
     STRIP_FLAGS="$STRIP_FLAGS -x -S"
     # Check whether we're targeting OS X or iOS
     echo $ac_n "checking for iOS target""... $ac_c" 1>&6
-echo "configure:9003: checking for iOS target" >&5
+echo "configure:9005: checking for iOS target" >&5
 if eval "test \"`echo '$''{'ac_cv_ios_target'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9008 "configure"
+#line 9010 "configure"
 #include "confdefs.h"
 #include <TargetConditionals.h>
 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
@@ -9014,7 +9016,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ios_target="yes"
 else
@@ -9072,18 +9074,18 @@ EOF
         echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
     else
                 echo $ac_n "checking for -dead_strip option to ld""... $ac_c" 1>&6
-echo "configure:9076: checking for -dead_strip option to ld" >&5
+echo "configure:9078: checking for -dead_strip option to ld" >&5
         _SAVE_LDFLAGS=$LDFLAGS
         LDFLAGS="$LDFLAGS -Wl,-dead_strip"
         cat > conftest.$ac_ext <<EOF
-#line 9080 "configure"
+#line 9082 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   _HAVE_DEAD_STRIP=1
 else
@@ -9104,18 +9106,18 @@ rm -f conftest*
     fi
 
             echo $ac_n "checking for -allow_heap_execute option to ld""... $ac_c" 1>&6
-echo "configure:9108: checking for -allow_heap_execute option to ld" >&5
+echo "configure:9110: checking for -allow_heap_execute option to ld" >&5
     _SAVE_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -Wl,-allow_heap_execute"
     cat > conftest.$ac_ext <<EOF
-#line 9112 "configure"
+#line 9114 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   _HAVE_ALLOW_HEAP_EXECUTE=1
 else
@@ -9229,7 +9231,7 @@ EOF
             MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
         esac
         MOZ_PGO_OPTIMIZE_FLAGS="-O3"
-        MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK"
+        MOZ_OPTIMIZE_FLAGS="-O2 -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK"
     fi
 
     TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
@@ -9281,7 +9283,7 @@ EOF
         # warnings are useless on mingw.
         
     echo $ac_n "checking whether the C compiler supports -Wno-format""... $ac_c" 1>&6
-echo "configure:9285: checking whether the C compiler supports -Wno-format" >&5
+echo "configure:9287: checking whether the C compiler supports -Wno-format" >&5
 if eval "test \"`echo '$''{'ac_c_has_wno_format'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9297,14 +9299,14 @@ cross_compiling=$ac_cv_prog_cc_cross
             _SAVE_CFLAGS="$CFLAGS"
             CFLAGS="$CFLAGS -Werror -Wformat"
             cat > conftest.$ac_ext <<EOF
-#line 9301 "configure"
+#line 9303 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:9308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_c_has_wno_format="yes"
 else
@@ -9332,7 +9334,7 @@ echo "$ac_t""$ac_c_has_wno_format" 1>&6
 
         
     echo $ac_n "checking whether the C++ compiler supports -Wno-format""... $ac_c" 1>&6
-echo "configure:9336: checking whether the C++ compiler supports -Wno-format" >&5
+echo "configure:9338: checking whether the C++ compiler supports -Wno-format" >&5
 if eval "test \"`echo '$''{'ac_cxx_has_wno_format'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9348,14 +9350,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
             _SAVE_CXXFLAGS="$CXXFLAGS"
             CXXFLAGS="$CXXFLAGS -Werror -Wformat"
             cat > conftest.$ac_ext <<EOF
-#line 9352 "configure"
+#line 9354 "configure"
 #include "confdefs.h"
 
 int main() {
 return(0);
 ; return 0; }
 EOF
-if { (eval echo configure:9359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cxx_has_wno_format="yes"
 else
@@ -9679,14 +9681,14 @@ EOF
            _SAVE_LDFLAGS=$LDFLAGS
            LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
            cat > conftest.$ac_ext <<EOF
-#line 9683 "configure"
+#line 9685 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello World\n");
 ; return 0; }
 EOF
-if { (eval echo configure:9690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -9714,7 +9716,7 @@ rm -f conftest*
        CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
        CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
        echo $ac_n "checking for Sun C++ compiler version >= 5.9""... $ac_c" 1>&6
-echo "configure:9718: checking for Sun C++ compiler version >= 5.9" >&5
+echo "configure:9720: checking for Sun C++ compiler version >= 5.9" >&5
        
        ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -9724,7 +9726,7 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
 
        cat > conftest.$ac_ext <<EOF
-#line 9728 "configure"
+#line 9730 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -9733,7 +9735,7 @@ int main() {
            #endif
 ; return 0; }
 EOF
-if { (eval echo configure:9737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   _BAD_COMPILER=
 else
@@ -9750,7 +9752,7 @@ rm -f conftest*
            _res="yes"
        fi
        cat > conftest.$ac_ext <<EOF
-#line 9754 "configure"
+#line 9756 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -9759,7 +9761,7 @@ int main() {
            #endif
 ; return 0; }
 EOF
-if { (eval echo configure:9763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   _ABOVE_SS12U1=
 else
@@ -9967,18 +9969,18 @@ MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMM
 
 if test -n "$MOZ_DEBUG"; then
     echo $ac_n "checking for valid debug flags""... $ac_c" 1>&6
-echo "configure:9971: checking for valid debug flags" >&5
+echo "configure:9973: checking for valid debug flags" >&5
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
     cat > conftest.$ac_ext <<EOF
-#line 9975 "configure"
+#line 9977 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello World\n");
 ; return 0; }
 EOF
-if { (eval echo configure:9982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   _results=yes
 else
@@ -10065,7 +10067,7 @@ if test "$CLANG_CXX"; then
 fi
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually is a C++ compiler""... $ac_c" 1>&6
-echo "configure:10069: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually is a C++ compiler" >&5
+echo "configure:10071: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually is a C++ compiler" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -10077,14 +10079,14 @@ cross_compiling=$ac_cv_prog_cxx_cross
 _SAVE_LIBS=$LIBS
 LIBS=
 cat > conftest.$ac_ext <<EOF
-#line 10081 "configure"
+#line 10083 "configure"
 #include "confdefs.h"
 #include <new>
 int main() {
 int *foo = new int;
 ; return 0; }
 EOF
-if { (eval echo configure:10088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -10179,7 +10181,7 @@ fi
 
 if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPER_OPTIONS"; then
     echo $ac_n "checking whether the linker supports Identical Code Folding""... $ac_c" 1>&6
-echo "configure:10183: checking whether the linker supports Identical Code Folding" >&5
+echo "configure:10185: checking whether the linker supports Identical Code Folding" >&5
 if eval "test \"`echo '$''{'LD_SUPPORTS_ICF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10188,7 +10190,7 @@ else
               'int main() {return foo() - bar();}' > conftest.${ac_ext}
         # If the linker supports ICF, foo and bar symbols will have
         # the same address
-        if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:10192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
+        if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:10194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
            test -s conftest${ac_exeext} &&
            objdump -t conftest${ac_exeext} | awk '{a[$6] = $1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'; then
             LD_SUPPORTS_ICF=yes
@@ -10203,14 +10205,14 @@ echo "$ac_t""$LD_SUPPORTS_ICF" 1>&6
         _SAVE_LDFLAGS="$LDFLAGS -Wl,--icf=safe"
         LDFLAGS="$LDFLAGS -Wl,--icf=safe -Wl,--print-icf-sections"
         cat > conftest.$ac_ext <<EOF
-#line 10207 "configure"
+#line 10209 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LD_PRINT_ICF_SECTIONS=-Wl,--print-icf-sections
 else
@@ -10229,15 +10231,15 @@ fi
 if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
     if test -n "$MOZ_DEBUG_FLAGS"; then
                 echo $ac_n "checking whether removing dead symbols breaks debugging""... $ac_c" 1>&6
-echo "configure:10233: checking whether removing dead symbols breaks debugging" >&5
+echo "configure:10235: checking whether removing dead symbols breaks debugging" >&5
 if eval "test \"`echo '$''{'GC_SECTIONS_BREAKS_DEBUG_RANGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'int foo() {return 42;}' \
                   'int bar() {return 1;}' \
                   'int main() {return foo();}' > conftest.${ac_ext}
-            if { ac_try='${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2'; { (eval echo configure:10240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
-                { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2'; { (eval echo configure:10241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
+            if { ac_try='${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2'; { (eval echo configure:10242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
+                { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2'; { (eval echo configure:10243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
                 test -s conftest${ac_exeext} -a -s conftest.${ac_objext}; then
                  if test "`$PYTHON -m mozbuild.configure.check_debug_ranges conftest.${ac_objext} conftest.${ac_ext}`" = \
                          "`$PYTHON -m mozbuild.configure.check_debug_ranges conftest${ac_exeext} conftest.${ac_ext}`"; then
@@ -10264,12 +10266,12 @@ fi
 
 if test -z "$SKIP_COMPILER_CHECKS"; then
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:10268: checking for ANSI C header files" >&5
+echo "configure:10270: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10273 "configure"
+#line 10275 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -10277,7 +10279,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10294,7 +10296,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 10298 "configure"
+#line 10300 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -10312,7 +10314,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 10316 "configure"
+#line 10318 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -10333,7 +10335,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 10337 "configure"
+#line 10339 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -10344,7 +10346,7 @@ if (XOR (islower (i), ISLOWER (i)) || to
 exit (0); }
 
 EOF
-if { (eval echo configure:10348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -10371,12 +10373,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:10375: checking for working const" >&5
+echo "configure:10377: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10380 "configure"
+#line 10382 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -10425,7 +10427,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -10449,12 +10451,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:10453: checking for mode_t" >&5
+echo "configure:10455: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10458 "configure"
+#line 10460 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -10485,12 +10487,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:10489: checking for off_t" >&5
+echo "configure:10491: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10494 "configure"
+#line 10496 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -10521,12 +10523,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:10525: checking for pid_t" >&5
+echo "configure:10527: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10530 "configure"
+#line 10532 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -10557,12 +10559,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:10561: checking for size_t" >&5
+echo "configure:10563: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10566 "configure"
+#line 10568 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -10607,12 +10609,12 @@ ac_link='${CC-cc} -o conftest${ac_exeext
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:10611: checking for ssize_t" >&5
+echo "configure:10613: checking for ssize_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10616 "configure"
+#line 10618 "configure"
 #include "confdefs.h"
 #include <stdio.h>
                   #include <sys/types.h>
@@ -10620,7 +10622,7 @@ int main() {
 ssize_t foo = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:10624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_ssize_t=true
 else
@@ -10645,12 +10647,12 @@ else
   echo "$ac_t""no" 1>&6
 fi
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:10649: checking for st_blksize in struct stat" >&5
+echo "configure:10651: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10654 "configure"
+#line 10656 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -10658,7 +10660,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:10662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -10682,12 +10684,12 @@ EOF
 fi
 
 echo $ac_n "checking for siginfo_t""... $ac_c" 1>&6
-echo "configure:10686: checking for siginfo_t" >&5
+echo "configure:10688: checking for siginfo_t" >&5
 if eval "test \"`echo '$''{'ac_cv_siginfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10691 "configure"
+#line 10693 "configure"
 #include "confdefs.h"
 #define _POSIX_C_SOURCE 199506L
                   #include <signal.h>
@@ -10695,7 +10697,7 @@ int main() {
 siginfo_t* info;
 ; return 0; }
 EOF
-if { (eval echo configure:10699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_siginfo_t=true
 else
@@ -10741,19 +10743,19 @@ if test "$GNU_CXX"; then
     _ADDED_CXXFLAGS="-std=gnu++0x"
 
     echo $ac_n "checking for gcc c++0x headers bug without rtti""... $ac_c" 1>&6
-echo "configure:10745: checking for gcc c++0x headers bug without rtti" >&5
+echo "configure:10747: checking for gcc c++0x headers bug without rtti" >&5
 if eval "test \"`echo '$''{'ac_cv_cxx0x_headers_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10750 "configure"
+#line 10752 "configure"
 #include "confdefs.h"
 #include <memory>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cxx0x_headers_bug="no"
 else
@@ -10771,19 +10773,19 @@ echo "$ac_t""$ac_cv_cxx0x_headers_bug" 1
         CXXFLAGS="$CXXFLAGS -I$_topsrcdir/build/unix/headers"
         _ADDED_CXXFLAGS="$_ADDED_CXXFLAGS -I$_topsrcdir/build/unix/headers"
         echo $ac_n "checking whether workaround for gcc c++0x headers conflict with clang works""... $ac_c" 1>&6
-echo "configure:10775: checking whether workaround for gcc c++0x headers conflict with clang works" >&5
+echo "configure:10777: checking whether workaround for gcc c++0x headers conflict with clang works" >&5
 if eval "test \"`echo '$''{'ac_cv_cxx0x_clang_workaround'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10780 "configure"
+#line 10782 "configure"
 #include "confdefs.h"
 #include <memory>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cxx0x_clang_workaround="yes"
 else
@@ -10824,19 +10826,19 @@ EOF
         CPPFLAGS="$HOST_CPPFLAGS"
         CXX="$HOST_CXX"
         echo $ac_n "checking for host gcc c++0x headers bug without rtti""... $ac_c" 1>&6
-echo "configure:10828: checking for host gcc c++0x headers bug without rtti" >&5
+echo "configure:10830: checking for host gcc c++0x headers bug without rtti" >&5
 if eval "test \"`echo '$''{'ac_cv_host_cxx0x_headers_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10833 "configure"
+#line 10835 "configure"
 #include "confdefs.h"
 #include <memory>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_host_cxx0x_headers_bug="no"
 else
@@ -10853,19 +10855,19 @@ echo "$ac_t""$ac_cv_host_cxx0x_headers_b
         if test "$host_compiler" = CLANG -a "$ac_cv_host_cxx0x_headers_bug" = "yes"; then
             CXXFLAGS="$CXXFLAGS -I$_topsrcdir/build/unix/headers"
             echo $ac_n "checking whether workaround for host gcc c++0x headers conflict with host clang works""... $ac_c" 1>&6
-echo "configure:10857: checking whether workaround for host gcc c++0x headers conflict with host clang works" >&5
+echo "configure:10859: checking whether workaround for host gcc c++0x headers conflict with host clang works" >&5
 if eval "test \"`echo '$''{'ac_cv_host_cxx0x_clang_workaround'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10862 "configure"
+#line 10864 "configure"
 #include "confdefs.h"
 #include <memory>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_host_cxx0x_clang_workaround="yes"
 else
@@ -10912,7 +10914,7 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 if test "$GNU_CC"; then
   echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
-echo "configure:10916: checking for visibility(hidden) attribute" >&5
+echo "configure:10918: checking for visibility(hidden) attribute" >&5
 if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10940,7 +10942,7 @@ EOF
 
 
     echo $ac_n "checking for visibility(default) attribute""... $ac_c" 1>&6
-echo "configure:10944: checking for visibility(default) attribute" >&5
+echo "configure:10946: checking for visibility(default) attribute" >&5
 if eval "test \"`echo '$''{'ac_cv_visibility_default'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10968,7 +10970,7 @@ EOF
 
 
       echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
-echo "configure:10972: checking for visibility pragma support" >&5
+echo "configure:10974: checking for visibility pragma support" >&5
 if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10993,7 +10995,7 @@ fi
 echo "$ac_t""$ac_cv_visibility_pragma" 1>&6
       if test "$ac_cv_visibility_pragma" = "yes"; then
         echo $ac_n "checking For gcc visibility bug with class-level attributes (GCC bug 26905)""... $ac_c" 1>&6
-echo "configure:10997: checking For gcc visibility bug with class-level attributes (GCC bug 26905)" >&5
+echo "configure:10999: checking For gcc visibility bug with class-level attributes (GCC bug 26905)" >&5
 if eval "test \"`echo '$''{'ac_cv_have_visibility_class_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11021,7 +11023,7 @@ fi
 echo "$ac_t""$ac_cv_have_visibility_class_bug" 1>&6
 
         echo $ac_n "checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)""... $ac_c" 1>&6
-echo "configure:11025: checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)" >&5
+echo "configure:11027: checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)" >&5
 if eval "test \"`echo '$''{'ac_cv_have_visibility_builtin_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11075,7 +11077,7 @@ fi         # Sun Studio on Solaris
 if test "$GNU_CC"; then
 
 echo $ac_n "checking for gcc PR49911""... $ac_c" 1>&6
-echo "configure:11079: checking for gcc PR49911" >&5
+echo "configure:11081: checking for gcc PR49911" >&5
 ac_have_gcc_pr49911="no"
 
 ac_ext=C
@@ -11092,7 +11094,7 @@ if test "$cross_compiling" = yes; then
   true
 else
   cat > conftest.$ac_ext <<EOF
-#line 11096 "configure"
+#line 11098 "configure"
 #include "confdefs.h"
 
 extern "C" void abort(void);
@@ -11133,7 +11135,7 @@ int main(void) {
 }
 
 EOF
-if { (eval echo configure:11137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   true
 else
@@ -11166,7 +11168,7 @@ fi
 
 
 echo $ac_n "checking for gcc pr39608""... $ac_c" 1>&6
-echo "configure:11170: checking for gcc pr39608" >&5
+echo "configure:11172: checking for gcc pr39608" >&5
 ac_have_gcc_pr39608="yes"
 
 ac_ext=C
@@ -11178,7 +11180,7 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 
 cat > conftest.$ac_ext <<EOF
-#line 11182 "configure"
+#line 11184 "configure"
 #include "confdefs.h"
 
 typedef void (*FuncType)();
@@ -11196,7 +11198,7 @@ int main() {
 true
 ; return 0; }
 EOF
-if { (eval echo configure:11200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_have_gcc_pr39608="no"
 else
@@ -11226,7 +11228,7 @@ if test "$OS_TARGET" != WINNT; then
     # cannot do enough code gen for now to make this test work correctly.
     
 echo $ac_n "checking for llvm pr8927""... $ac_c" 1>&6
-echo "configure:11230: checking for llvm pr8927" >&5
+echo "configure:11232: checking for llvm pr8927" >&5
 ac_have_llvm_pr8927="no"
 
 ac_ext=c
@@ -11243,7 +11245,7 @@ if test "$cross_compiling" = yes; then
   true
 else
   cat > conftest.$ac_ext <<EOF
-#line 11247 "configure"
+#line 11249 "configure"
 #include "confdefs.h"
 
 struct foobar {
@@ -11266,7 +11268,7 @@ int main() {
 }
 
 EOF
-if { (eval echo configure:11270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   true
 else
@@ -11304,19 +11306,19 @@ if test "$GNU_CC"; then
   CFLAGS_save="${CFLAGS}"
   CFLAGS="${CFLAGS} -Werror"
   echo $ac_n "checking for __force_align_arg_pointer__ attribute""... $ac_c" 1>&6
-echo "configure:11308: checking for __force_align_arg_pointer__ attribute" >&5
+echo "configure:11310: checking for __force_align_arg_pointer__ attribute" >&5
 if eval "test \"`echo '$''{'ac_cv_force_align_arg_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11313 "configure"
+#line 11315 "configure"
 #include "confdefs.h"
 __attribute__ ((__force_align_arg_pointer__)) void test() {}
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_force_align_arg_pointer="yes"
 else
@@ -11343,12 +11345,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:11347: checking for $ac_hdr that defines DIR" >&5
+echo "configure:11349: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11352 "configure"
+#line 11354 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -11356,7 +11358,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -11384,7 +11386,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:11388: checking for opendir in -ldir" >&5
+echo "configure:11390: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11392,7 +11394,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11396 "configure"
+#line 11398 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11403,7 +11405,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:11407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11425,7 +11427,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:11429: checking for opendir in -lx" >&5
+echo "configure:11431: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11433,7 +11435,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11437 "configure"
+#line 11439 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11444,7 +11446,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:11448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11478,12 +11480,12 @@ esac
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11482: checking for $ac_hdr" >&5
+echo "configure:11484: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11487 "configure"
+#line 11489 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -11491,7 +11493,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11526,12 +11528,12 @@ EOF
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11530: checking for $ac_hdr" >&5
+echo "configure:11532: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11535 "configure"
+#line 11537 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -11539,7 +11541,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11573,12 +11575,12 @@ EOF
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11577: checking for $ac_hdr" >&5
+echo "configure:11579: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11582 "configure"
+#line 11584 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -11586,7 +11588,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11619,12 +11621,12 @@ EOF
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11623: checking for $ac_hdr" >&5
+echo "configure:11625: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11628 "configure"
+#line 11630 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 #include <$ac_hdr>
@@ -11632,7 +11634,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11666,12 +11668,12 @@ EOF
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11670: checking for $ac_hdr" >&5
+echo "configure:11672: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11675 "configure"
+#line 11677 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 #include <$ac_hdr>
@@ -11679,7 +11681,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11713,12 +11715,12 @@ EOF
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11717: checking for $ac_hdr" >&5
+echo "configure:11719: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11722 "configure"
+#line 11724 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -11726,7 +11728,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11757,12 +11759,12 @@ EOF
 
 
 echo $ac_n "checking for sockaddr_in.sin_len""... $ac_c" 1>&6
-echo "configure:11761: checking for sockaddr_in.sin_len" >&5
+echo "configure:11763: checking for sockaddr_in.sin_len" >&5
 if eval "test \"`echo '$''{'ac_cv_sockaddr_in_sin_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11766 "configure"
+#line 11768 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
                                     #include <sys/types.h>
@@ -11774,7 +11776,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sockaddr_in_sin_len=true
 else
@@ -11805,12 +11807,12 @@ EOF
 fi
 
 echo $ac_n "checking for sockaddr_in6.sin6_len""... $ac_c" 1>&6
-echo "configure:11809: checking for sockaddr_in6.sin6_len" >&5
+echo "configure:11811: checking for sockaddr_in6.sin6_len" >&5
 if eval "test \"`echo '$''{'ac_cv_sockaddr_in6_sin6_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11814 "configure"
+#line 11816 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
                                 #include <sys/types.h>
@@ -11822,7 +11824,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sockaddr_in6_sin6_len=true
 else
@@ -11846,12 +11848,12 @@ EOF
 fi
 
 echo $ac_n "checking for sockaddr.sa_len""... $ac_c" 1>&6
-echo "configure:11850: checking for sockaddr.sa_len" >&5
+echo "configure:11852: checking for sockaddr.sa_len" >&5
 if eval "test \"`echo '$''{'ac_cv_sockaddr_sa_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11855 "configure"
+#line 11857 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
                                 #include <sys/types.h>
@@ -11863,7 +11865,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sockaddr_sa_len=true
 else
@@ -11895,12 +11897,12 @@ fi
 if test "x$enable_dtrace" = "xyes"; then
      ac_safe=`echo "sys/sdt.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for sys/sdt.h""... $ac_c" 1>&6
-echo "configure:11899: checking for sys/sdt.h" >&5
+echo "configure:11901: checking for sys/sdt.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11904 "configure"
+#line 11906 "configure"
 #include "confdefs.h"
 
 #include <sys/sdt.h>
@@ -11908,7 +11910,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -11950,12 +11952,12 @@ case $target in
   do
        ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11954: checking for $ac_hdr" >&5
+echo "configure:11956: checking for $ac_hdr" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 11959 "configure"
+#line 11961 "configure"
 #include "confdefs.h"
 
 #include <$ac_hdr>
@@ -11963,7 +11965,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -12015,12 +12017,12 @@ CFLAGS="$CFLAGS $LINUX_HEADERS_INCLUDES"
 
    ac_safe=`echo "linux/perf_event.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for linux/perf_event.h""... $ac_c" 1>&6
-echo "configure:12019: checking for linux/perf_event.h" >&5
+echo "configure:12021: checking for linux/perf_event.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 12024 "configure"
+#line 12026 "configure"
 #include "confdefs.h"
 
 #include <linux/perf_event.h>
@@ -12028,7 +12030,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -12043,19 +12045,19 @@ fi
   if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
     echo "$ac_t""yes" 1>&6
     echo $ac_n "checking for perf_event_open system call""... $ac_c" 1>&6
-echo "configure:12047: checking for perf_event_open system call" >&5
+echo "configure:12049: checking for perf_event_open system call" >&5
 if eval "test \"`echo '$''{'ac_cv_perf_event_open'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12052 "configure"
+#line 12054 "configure"
 #include "confdefs.h"
 #include <asm/unistd.h>
 int main() {
 return sizeof(__NR_perf_event_open);
 ; return 0; }
 EOF
-if { (eval echo configure:12059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_perf_event_open=yes
 else
@@ -12091,7 +12093,7 @@ case $target in
     ;;
 *)
     echo $ac_n "checking for gethostbyname_r in -lc_r""... $ac_c" 1>&6
-echo "configure:12095: checking for gethostbyname_r in -lc_r" >&5
+echo "configure:12097: checking for gethostbyname_r in -lc_r" >&5
 ac_lib_var=`echo c_r'_'gethostbyname_r | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12099,7 +12101,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12103 "configure"
+#line 12105 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12110,7 +12112,7 @@ int main() {
 gethostbyname_r()
 ; return 0; }
 EOF
-if { (eval echo configure:12114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12149,14 +12151,14 @@ case $target in
 *)
     
 echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6
-echo "configure:12153: checking for library containing dlopen" >&5
+echo "configure:12155: checking for library containing dlopen" >&5
 if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_dlopen="no"
 cat > conftest.$ac_ext <<EOF
-#line 12160 "configure"
+#line 12162 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12167,7 +12169,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:12171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_dlopen="none required"
 else
@@ -12178,7 +12180,7 @@ rm -f conftest*
 test "$ac_cv_search_dlopen" = "no" && for i in dl; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12182 "configure"
+#line 12184 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12189,7 +12191,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:12193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_dlopen="-l$i"
 break
@@ -12207,12 +12209,12 @@ if test "$ac_cv_search_dlopen" != "no";
   test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS"
      ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:12211: checking for dlfcn.h" >&5
+echo "configure:12213: checking for dlfcn.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 12216 "configure"
+#line 12218 "configure"
 #include "confdefs.h"
 
 #include <dlfcn.h>
@@ -12220,7 +12222,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -12257,12 +12259,12 @@ CFLAGS="$CFLAGS -D_GNU_SOURCE"
 for ac_func in dladdr memmem
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12261: checking for $ac_func" >&5
+echo "configure:12263: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func2_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12266 "configure"
+#line 12268 "configure"
 #define $ac_func innocuous_$ac_func
 #include "confdefs.h"
 #undef $ac_func
@@ -12289,7 +12291,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:12293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func2_$ac_func=yes"
 else
@@ -12323,7 +12325,7 @@ if test ! "$GNU_CXX"; then
     case $target in
     *-aix*)
         echo $ac_n "checking for demangle in -lC_r""... $ac_c" 1>&6
-echo "configure:12327: checking for demangle in -lC_r" >&5
+echo "configure:12329: checking for demangle in -lC_r" >&5
 ac_lib_var=`echo C_r'_'demangle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12331,7 +12333,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lC_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12335 "configure"
+#line 12337 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12342,7 +12344,7 @@ int main() {
 demangle()
 ; return 0; }
 EOF
-if { (eval echo configure:12346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12375,7 +12377,7 @@ fi
         ;;
      *)
         echo $ac_n "checking for demangle in -lC""... $ac_c" 1>&6
-echo "configure:12379: checking for demangle in -lC" >&5
+echo "configure:12381: checking for demangle in -lC" >&5
 ac_lib_var=`echo C'_'demangle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12383,7 +12385,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lC  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12387 "configure"
+#line 12389 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12394,7 +12396,7 @@ int main() {
 demangle()
 ; return 0; }
 EOF
-if { (eval echo configure:12398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12429,7 +12431,7 @@ fi
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:12433: checking for socket in -lsocket" >&5
+echo "configure:12435: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12437,7 +12439,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12441 "configure"
+#line 12443 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12448,7 +12450,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:12452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12502,7 +12504,7 @@ EOF
     _SAVE_LDFLAGS="$LDFLAGS"
     LDFLAGS="$XLDFLAGS $LDFLAGS"
     echo $ac_n "checking for XDrawLines in -lX11""... $ac_c" 1>&6
-echo "configure:12506: checking for XDrawLines in -lX11" >&5
+echo "configure:12508: checking for XDrawLines in -lX11" >&5
 ac_lib_var=`echo X11'_'XDrawLines | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12510,7 +12512,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $XLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12514 "configure"
+#line 12516 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12521,7 +12523,7 @@ int main() {
 XDrawLines()
 ; return 0; }
 EOF
-if { (eval echo configure:12525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12543,7 +12545,7 @@ MISSING_X="$MISSING_X -lX11"
 fi
 
     echo $ac_n "checking for XextAddDisplay in -lXext""... $ac_c" 1>&6
-echo "configure:12547: checking for XextAddDisplay in -lXext" >&5
+echo "configure:12549: checking for XextAddDisplay in -lXext" >&5
 ac_lib_var=`echo Xext'_'XextAddDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12551,7 +12553,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext $XLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12555 "configure"
+#line 12557 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12562,7 +12564,7 @@ int main() {
 XextAddDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:12566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12585,7 +12587,7 @@ fi
 
 
     echo $ac_n "checking for XtFree in -lXt""... $ac_c" 1>&6
-echo "configure:12589: checking for XtFree in -lXt" >&5
+echo "configure:12591: checking for XtFree in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtFree | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12593,7 +12595,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12597 "configure"
+#line 12599 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12604,7 +12606,7 @@ int main() {
 XtFree()
 ; return 0; }
 EOF
-if { (eval echo configure:12608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12625,7 +12627,7 @@ else
 
         unset ac_cv_lib_Xt_XtFree
         echo $ac_n "checking for IceFlush in -lICE""... $ac_c" 1>&6
-echo "configure:12629: checking for IceFlush in -lICE" >&5
+echo "configure:12631: checking for IceFlush in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceFlush | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12633,7 +12635,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $XT_LIBS $XLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12637 "configure"
+#line 12639 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12644,7 +12646,7 @@ int main() {
 IceFlush()
 ; return 0; }
 EOF
-if { (eval echo configure:12648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12665,7 +12667,7 @@ else
 fi
 
         echo $ac_n "checking for SmcCloseConnection in -lSM""... $ac_c" 1>&6
-echo "configure:12669: checking for SmcCloseConnection in -lSM" >&5
+echo "configure:12671: checking for SmcCloseConnection in -lSM" >&5
 ac_lib_var=`echo SM'_'SmcCloseConnection | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12673,7 +12675,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lSM $XT_LIBS $XLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12677 "configure"
+#line 12679 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12684,7 +12686,7 @@ int main() {
 SmcCloseConnection()
 ; return 0; }
 EOF
-if { (eval echo configure:12688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12705,7 +12707,7 @@ else
 fi
 
         echo $ac_n "checking for XtFree in -lXt""... $ac_c" 1>&6
-echo "configure:12709: checking for XtFree in -lXt" >&5
+echo "configure:12711: checking for XtFree in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtFree | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12713,7 +12715,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt $X_PRE_LIBS $XT_LIBS $XLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12717 "configure"
+#line 12719 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12724,7 +12726,7 @@ int main() {
 XtFree()
 ; return 0; }
 EOF
-if { (eval echo configure:12728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12758,7 +12760,7 @@ fi
     esac
 
                 echo $ac_n "checking for XShmCreateImage in -lXext""... $ac_c" 1>&6
-echo "configure:12762: checking for XShmCreateImage in -lXext" >&5
+echo "configure:12764: checking for XShmCreateImage in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShmCreateImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12766,7 +12768,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext $XLIBS $XEXT_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12770 "configure"
+#line 12772 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12777,7 +12779,7 @@ int main() {
 XShmCreateImage()
 ; return 0; }
 EOF
-if { (eval echo configure:12781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12800,12 +12802,12 @@ fi
 
                    ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
-echo "configure:12804: checking for X11/extensions/scrnsaver.h" >&5
+echo "configure:12806: checking for X11/extensions/scrnsaver.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 12809 "configure"
+#line 12811 "configure"
 #include "confdefs.h"
 
 #include <X11/extensions/scrnsaver.h>
@@ -12813,7 +12815,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -12828,7 +12830,7 @@ fi
   if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
     echo "$ac_t""yes" 1>&6
     echo $ac_n "checking for XScreenSaverQueryInfo in -lXss""... $ac_c" 1>&6
-echo "configure:12832: checking for XScreenSaverQueryInfo in -lXss" >&5
+echo "configure:12834: checking for XScreenSaverQueryInfo in -lXss" >&5
 ac_lib_var=`echo Xss'_'XScreenSaverQueryInfo | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12836,7 +12838,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXss $XEXT_LIBS $XLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12840 "configure"
+#line 12842 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12847,7 +12849,7 @@ int main() {
 XScreenSaverQueryInfo()
 ; return 0; }
 EOF
-if { (eval echo configure:12851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12897,7 +12899,7 @@ darwin*)
 *)
     
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:12901: checking for pthread_create in -lpthreads" >&5
+echo "configure:12903: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h>
     #include <stdlib.h>
@@ -12920,7 +12922,7 @@ echo "
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:12924: checking for pthread_create in -lpthread" >&5
+echo "configure:12926: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h>
     #include <stdlib.h>
@@ -12943,7 +12945,7 @@ echo "
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:12947: checking for pthread_create in -lc_r" >&5
+echo "configure:12949: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h>
     #include <stdlib.h>
@@ -12966,7 +12968,7 @@ echo "
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:12970: checking for pthread_create in -lc" >&5
+echo "configure:12972: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h>
     #include <stdlib.h>
@@ -13025,7 +13027,7 @@ then
                 rm -f conftest*
     ac_cv_have_dash_pthread=no
     echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:13029: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:13031: checking whether ${CC-cc} accepts -pthread" >&5
     echo 'int main() { return 0; }' | cat > conftest.c
     ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
     if test $? -eq 0; then
@@ -13048,7 +13050,7 @@ echo "configure:13029: checking whether
                 ac_cv_have_dash_pthreads=no
     if test "$ac_cv_have_dash_pthread" = "no"; then
         echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:13052: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:13054: checking whether ${CC-cc} accepts -pthreads" >&5
         echo 'int main() { return 0; }' | cat > conftest.c
         ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
         if test $? -eq 0; then
@@ -13154,13 +13156,13 @@ fi
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:13158: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:13160: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 13164 "configure"
+#line 13166 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
@@ -13178,7 +13180,7 @@ rm -f conftest*
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 13182 "configure"
+#line 13184 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
@@ -13200,7 +13202,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:13204: checking for 8-bit clean memcmp" >&5
+echo "configure:13206: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13208,7 +13210,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 13212 "configure"
+#line 13214 "configure"
 #include "confdefs.h"
 
 main()
@@ -13218,7 +13220,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:13222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -13238,12 +13240,12 @@ test $ac_cv_func_memcmp_clean = no && LI
 for ac_func in stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13242: checking for $ac_func" >&5
+echo "configure:13244: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func2_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13247 "configure"
+#line 13249 "configure"
 #define $ac_func innocuous_$ac_func
 #include "confdefs.h"
 #undef $ac_func
@@ -13270,7 +13272,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:13274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func2_$ac_func=yes"
 else
@@ -13299,7 +13301,7 @@ done
 
 
 echo $ac_n "checking for clock_gettime(CLOCK_MONOTONIC)""... $ac_c" 1>&6
-echo "configure:13303: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
+echo "configure:13305: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
 if eval "test \"`echo '$''{'ac_cv_clock_monotonic'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13307,7 +13309,7 @@ else
                     _SAVE_LIBS="$LIBS"
                     LIBS="$LIBS $libs"
                     cat > conftest.$ac_ext <<EOF
-#line 13311 "configure"
+#line 13313 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
@@ -13315,7 +13317,7 @@ int main() {
                                    clock_gettime(CLOCK_MONOTONIC, &ts); 
 ; return 0; }
 EOF
-if { (eval echo configure:13319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_clock_monotonic=$libs
                                  LIBS="$_SAVE_LIBS"
@@ -13356,19 +13358,19 @@ ac_link='${CXX-g++} -o conftest${ac_exee
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking for wcrtomb""... $ac_c" 1>&6
-echo "configure:13360: checking for wcrtomb" >&5
+echo "configure:13362: checking for wcrtomb" >&5
 if eval "test \"`echo '$''{'ac_cv_have_wcrtomb'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13365 "configure"
+#line 13367 "configure"
 #include "confdefs.h"
 #include <wchar.h>
 int main() {
 mbstate_t ps={0};wcrtomb(0,'f',&ps);
 ; return 0; }
 EOF
-if { (eval echo configure:13372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_have_wcrtomb="yes"
 else
@@ -13391,19 +13393,19 @@ EOF
 
 fi
 echo $ac_n "checking for mbrtowc""... $ac_c" 1>&6
-echo "configure:13395: checking for mbrtowc" >&5
+echo "configure:13397: checking for mbrtowc" >&5
 if eval "test \"`echo '$''{'ac_cv_have_mbrtowc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13400 "configure"
+#line 13402 "configure"
 #include "confdefs.h"
 #include <wchar.h>
 int main() {
 mbstate_t ps={0};mbrtowc(0,0,0,&ps);
 ; return 0; }
 EOF
-if { (eval echo configure:13407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_have_mbrtowc="yes"
 else
@@ -13435,7 +13437,7 @@ cross_compiling=$ac_cv_prog_cc_cross
 fi
 
 echo $ac_n "checking for res_ninit()""... $ac_c" 1>&6
-echo "configure:13439: checking for res_ninit()" >&5
+echo "configure:13441: checking for res_ninit()" >&5
 if eval "test \"`echo '$''{'ac_cv_func_res_ninit'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13443,7 +13445,7 @@ else
                 ac_cv_func_res_ninit=no
      else
         cat > conftest.$ac_ext <<EOF
-#line 13447 "configure"
+#line 13449 "configure"
 #include "confdefs.h"
 
             #ifdef linux
@@ -13458,7 +13460,7 @@ int main() {
 int foo = res_ninit(&_res);
 ; return 0; }
 EOF
-if { (eval echo configure:13462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_res_ninit=yes
 else
@@ -13498,7 +13500,7 @@ case $target_os in
     *)
 
 echo $ac_n "checking for iconv in -lc""... $ac_c" 1>&6
-echo "configure:13502: checking for iconv in -lc" >&5
+echo "configure:13504: checking for iconv in -lc" >&5
 ac_lib_var=`echo c'_'iconv | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13506,7 +13508,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13510 "configure"
+#line 13512 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -13520,7 +13522,7 @@ int main() {
 iconv()
 ; return 0; }
 EOF
-if { (eval echo configure:13524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13539,7 +13541,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:13543: checking for iconv in -liconv" >&5
+echo "configure:13545: checking for iconv in -liconv" >&5
 ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13547,7 +13549,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liconv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13551 "configure"
+#line 13553 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -13561,7 +13563,7 @@ int main() {
 iconv()
 ; return 0; }
 EOF
-if { (eval echo configure:13565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13580,7 +13582,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6
-echo "configure:13584: checking for libiconv in -liconv" >&5
+echo "configure:13586: checking for libiconv in -liconv" >&5
 ac_lib_var=`echo iconv'_'libiconv | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13588,7 +13590,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liconv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13592 "configure"
+#line 13594 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -13602,7 +13604,7 @@ int main() {
 libiconv()
 ; return 0; }
 EOF
-if { (eval echo configure:13606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13629,12 +13631,12 @@ fi
 _SAVE_LIBS=$LIBS
 LIBS="$LIBS $_ICONV_LIBS"
 echo $ac_n "checking for iconv()""... $ac_c" 1>&6
-echo "configure:13633: checking for iconv()" >&5
+echo "configure:13635: checking for iconv()" >&5
 if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13638 "configure"
+#line 13640 "configure"
 #include "confdefs.h"
 
         #include <stdlib.h>
@@ -13648,7 +13650,7 @@ int main() {
         
 ; return 0; }
 EOF
-if { (eval echo configure:13652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_iconv=yes
 else
@@ -13674,12 +13676,12 @@ EOF
     LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
     LIBICONV="$_ICONV_LIBS"
     echo $ac_n "checking for iconv() with const input""... $ac_c" 1>&6
-echo "configure:13678: checking for iconv() with const input" >&5
+echo "configure:13680: checking for iconv() with const input" >&5
 if eval "test \"`echo '$''{'ac_cv_func_const_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13683 "configure"
+#line 13685 "configure"
 #include "confdefs.h"
 
             #include <stdlib.h>
@@ -13694,7 +13696,7 @@ int main() {
             
 ; return 0; }
 EOF
-if { (eval echo configure:13698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_const_iconv=yes
 else
@@ -13726,19 +13728,19 @@ esac
 
 
   echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:13730: checking for nl_langinfo and CODESET" >&5
+echo "configure:13732: checking for nl_langinfo and CODESET" >&5
 if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13735 "configure"
+#line 13737 "configure"
 #include "confdefs.h"
 #include <langinfo.h>
 int main() {
 char* cs = nl_langinfo(CODESET);
 ; return 0; }
 EOF
-if { (eval echo configure:13742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_langinfo_codeset=yes
 else
@@ -13773,12 +13775,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 
 echo $ac_n "checking for an implementation of va_copy()""... $ac_c" 1>&6
-echo "configure:13777: checking for an implementation of va_copy()" >&5
+echo "configure:13779: checking for an implementation of va_copy()" >&5
 if eval "test \"`echo '$''{'ac_cv_va_copy'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13782 "configure"
+#line 13784 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
                      #include <stdlib.h>
@@ -13794,7 +13796,7 @@ int main() {
 f(0, 42); return 0
 ; return 0; }
 EOF
-if { (eval echo configure:13798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_va_copy=yes
 else
@@ -13810,12 +13812,12 @@ fi
 
 echo "$ac_t""$ac_cv_va_copy" 1>&6
 echo $ac_n "checking whether va_list can be copied by value""... $ac_c" 1>&6
-echo "configure:13814: checking whether va_list can be copied by value" >&5
+echo "configure:13816: checking whether va_list can be copied by value" >&5
 if eval "test \"`echo '$''{'ac_cv_va_val_copy'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13819 "configure"
+#line 13821 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
                      #include <stdlib.h>
@@ -13831,7 +13833,7 @@ int main() {
 f(0, 42); return 0
 ; return 0; }
 EOF
-if { (eval echo configure:13835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_va_val_copy=yes
 else
@@ -13884,12 +13886,12 @@ ARM_ABI_PREFIX=
 if test "$GNU_CC"; then
   if test "$CPU_ARCH" = "arm" ; then
     echo $ac_n "checking for ARM EABI""... $ac_c" 1>&6
-echo "configure:13888: checking for ARM EABI" >&5
+echo "configure:13890: checking for ARM EABI" >&5
 if eval "test \"`echo '$''{'ac_cv_gcc_arm_eabi'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13893 "configure"
+#line 13895 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -13902,7 +13904,7 @@ int main() {
                         
 ; return 0; }
 EOF
-if { (eval echo configure:13906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_gcc_arm_eabi="yes"
 else
@@ -13927,12 +13929,12 @@ echo "$ac_t""$ac_cv_gcc_arm_eabi" 1>&6
 fi
 
 echo $ac_n "checking whether the C++ \"using\" keyword resolves ambiguity""... $ac_c" 1>&6
-echo "configure:13931: checking whether the C++ \"using\" keyword resolves ambiguity" >&5
+echo "configure:13933: checking whether the C++ \"using\" keyword resolves ambiguity" >&5
 if eval "test \"`echo '$''{'ac_cv_cpp_ambiguity_resolving_using'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13936 "configure"
+#line 13938 "configure"
 #include "confdefs.h"
 class X {
                                  public: int go(const X&) {return 3;}
@@ -13948,7 +13950,7 @@ int main() {
 X x; Y y; y.jo(x);
 ; return 0; }
 EOF
-if { (eval echo configure:13952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cpp_ambiguity_resolving_using=yes
 else
@@ -13972,7 +13974,7 @@ EOF
 fi
 
 echo $ac_n "checking for C++ dynamic_cast to void*""... $ac_c" 1>&6
-echo "configure:13976: checking for C++ dynamic_cast to void*" >&5
+echo "configure:13978: checking for C++ dynamic_cast to void*" >&5
 if eval "test \"`echo '$''{'ac_cv_cpp_dynamic_cast_void_ptr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13980,7 +13982,7 @@ else
   ac_cv_cpp_dynamic_cast_void_ptr=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 13984 "configure"
+#line 13986 "configure"
 #include "confdefs.h"
 class X { int i; public: virtual ~X() { } };
                             class Y { int j; public: virtual ~Y() { } };
@@ -13996,7 +13998,7 @@ class X { int i; public: virtual ~X() {
                                            ((void*)&mdo == dynamic_cast<void*>(suby))));
                             }
 EOF
-if { (eval echo configure:14000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_cpp_dynamic_cast_void_ptr=yes
 else
@@ -14023,19 +14025,19 @@ fi
 
 
 echo $ac_n "checking whether C++ requires implementation of unused virtual methods""... $ac_c" 1>&6
-echo "configure:14027: checking whether C++ requires implementation of unused virtual methods" >&5
+echo "configure:14029: checking whether C++ requires implementation of unused virtual methods" >&5
 if eval "test \"`echo '$''{'ac_cv_cpp_unused_required'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14032 "configure"
+#line 14034 "configure"
 #include "confdefs.h"
 class X {private: virtual void never_called();};
 int main() {
 X x;
 ; return 0; }
 EOF
-if { (eval echo configure:14039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_cpp_unused_required=no
 else
@@ -14061,12 +14063,12 @@ fi
 
 
 echo $ac_n "checking for trouble comparing to zero near std::operator!=()""... $ac_c" 1>&6
-echo "configure:14065: checking for trouble comparing to zero near std::operator!=()" >&5
+echo "configure:14067: checking for trouble comparing to zero near std::operator!=()" >&5
 if eval "test \"`echo '$''{'ac_cv_trouble_comparing_to_zero'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14070 "configure"
+#line 14072 "configure"
 #include "confdefs.h"
 #include <algorithm>
                                 template <class T> class Foo {};
@@ -14077,7 +14079,7 @@ int main() {
 Foo<int> f; return (0 != f);
 ; return 0; }
 EOF
-if { (eval echo configure:14081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_trouble_comparing_to_zero=no
 else
@@ -14107,19 +14109,19 @@ fi
 _SAVE_LDFLAGS=$LDFLAGS
 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
 echo $ac_n "checking for __thread keyword for TLS variables""... $ac_c" 1>&6
-echo "configure:14111: checking for __thread keyword for TLS variables" >&5
+echo "configure:14113: checking for __thread keyword for TLS variables" >&5
 if eval "test \"`echo '$''{'ac_cv_thread_keyword'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14116 "configure"
+#line 14118 "configure"
 #include "confdefs.h"
 __thread bool tlsIsMainThread = false;
 int main() {
 return tlsIsMainThread;
 ; return 0; }
 EOF
-if { (eval echo configure:14123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_thread_keyword=yes
 else
@@ -14173,12 +14175,12 @@ fi
 
 if test -n "$MOZ_LINKER" -a "$OS_TARGET" = "Android"; then
   echo $ac_n "checking whether the CRT objects have text relocations""... $ac_c" 1>&6
-echo "configure:14177: checking whether the CRT objects have text relocations" >&5
+echo "configure:14179: checking whether the CRT objects have text relocations" >&5
 if eval "test \"`echo '$''{'ac_cv_crt_has_text_relocations'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'int foo() { return 0; }' > conftest.cpp
-     if { ac_try='${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5'; { (eval echo configure:14182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
+     if { ac_try='${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5'; { (eval echo configure:14184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
         test -s conftest${DLL_SUFFIX}; then
        if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
          ac_cv_crt_has_text_relocations=yes
@@ -14205,12 +14207,12 @@ MALLOC_H=
 for file in $MALLOC_HEADERS; do
      ac_safe=`echo "$file" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for $file""... $ac_c" 1>&6
-echo "configure:14209: checking for $file" >&5
+echo "configure:14211: checking for $file" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 14214 "configure"
+#line 14216 "configure"
 #include "confdefs.h"
 
 #include <$file>
@@ -14218,7 +14220,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -14253,12 +14255,12 @@ done
 for ac_func in strndup posix_memalign memalign valloc
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14257: checking for $ac_func" >&5
+echo "configure:14259: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func2_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14262 "configure"
+#line 14264 "configure"
 #define $ac_func innocuous_$ac_func
 #include "confdefs.h"
 #undef $ac_func
@@ -14288,7 +14290,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:14292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func2_$ac_func=yes"
 else
@@ -14319,12 +14321,12 @@ done
 for ac_func in malloc_usable_size
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14323: checking for $ac_func" >&5
+echo "configure:14325: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func2_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14328 "configure"
+#line 14330 "configure"
 #define $ac_func innocuous_$ac_func
 #include "confdefs.h"
 #undef $ac_func
@@ -14354,7 +14356,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:14358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func2_$ac_func=yes"
 else
@@ -14384,19 +14386,19 @@ done
 
 
 echo $ac_n "checking for __attribute__((always_inline))""... $ac_c" 1>&6
-echo "configure:14388: checking for __attribute__((always_inline))" >&5
+echo "configure:14390: checking for __attribute__((always_inline))" >&5
 if eval "test \"`echo '$''{'ac_cv_attribute_always_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14393 "configure"
+#line 14395 "configure"
 #include "confdefs.h"
 inline void f(void) __attribute__((always_inline));
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_attribute_always_inline=yes
 else
@@ -14411,19 +14413,19 @@ fi
 echo "$ac_t""$ac_cv_attribute_always_inline" 1>&6
 
 echo $ac_n "checking for __attribute__((malloc))""... $ac_c" 1>&6
-echo "configure:14415: checking for __attribute__((malloc))" >&5
+echo "configure:14417: checking for __attribute__((malloc))" >&5
 if eval "test \"`echo '$''{'ac_cv_attribute_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14420 "configure"
+#line 14422 "configure"
 #include "confdefs.h"
 void* f(int) __attribute__((malloc));
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_attribute_malloc=yes
 else
@@ -14438,19 +14440,19 @@ fi
 echo "$ac_t""$ac_cv_attribute_malloc" 1>&6
 
 echo $ac_n "checking for __attribute__((warn_unused_result))""... $ac_c" 1>&6
-echo "configure:14442: checking for __attribute__((warn_unused_result))" >&5
+echo "configure:14444: checking for __attribute__((warn_unused_result))" >&5
 if eval "test \"`echo '$''{'ac_cv_attribute_warn_unused'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14447 "configure"
+#line 14449 "configure"
 #include "confdefs.h"
 int f(void) __attribute__((warn_unused_result));
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_attribute_warn_unused=yes
 else
@@ -14474,19 +14476,19 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 
 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:14478: checking for LC_MESSAGES" >&5
+echo "configure:14480: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'ac_cv_i18n_lc_messages'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14483 "configure"
+#line 14485 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 int category = LC_MESSAGES;
 ; return 0; }
 EOF
-if { (eval echo configure:14490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_i18n_lc_messages=yes
 else
@@ -14512,12 +14514,12 @@ fi
 for ac_func in localeconv
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14516: checking for $ac_func" >&5
+echo "configure:14518: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func2_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14521 "configure"
+#line 14523 "configure"
 #define $ac_func innocuous_$ac_func
 #include "confdefs.h"
 #undef $ac_func
@@ -14544,7 +14546,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:14548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func2_$ac_func=yes"
 else
@@ -14733,7 +14735,7 @@ fi
 	# Extract the first word of "nspr-config", so it can be a program name with args.
 set dummy nspr-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:14737: checking for $ac_word" >&5
+echo "configure:14739: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NSPR_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14768,7 +14770,7 @@ fi
 
 	min_nspr_version=4.10.6
 	echo $ac_n "checking for NSPR - version >= $min_nspr_version""... $ac_c" 1>&6
-echo "configure:14772: checking for NSPR - version >= $min_nspr_version" >&5
+echo "configure:14774: checking for NSPR - version >= $min_nspr_version" >&5
 
 	no_nspr=""
 	if test "$NSPR_CONFIG" != "no"; then
@@ -14827,7 +14829,7 @@ if test -n "$MOZ_NATIVE_NSPR"; then
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS $NSPR_CFLAGS"
     cat > conftest.$ac_ext <<EOF
-#line 14831 "configure"
+#line 14833 "configure"
 #include "confdefs.h"
 #include "prtypes.h"
 int main() {
@@ -14836,7 +14838,7 @@ int main() {
                  #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_NATIVE_NSPR=1
 else
@@ -14847,7 +14849,7 @@ else
 fi
 rm -f conftest*
     cat > conftest.$ac_ext <<EOF
-#line 14851 "configure"
+#line 14853 "configure"
 #include "confdefs.h"
 #include "prtypes.h"
 int main() {
@@ -14856,7 +14858,7 @@ int main() {
                  #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_NATIVE_NSPR=1
 else
@@ -14956,7 +14958,7 @@ if test "$LIBEVENT_DIR" = yes; then
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:14960: checking for $ac_word" >&5
+echo "configure:14962: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15000,19 +15002,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for libevent""... $ac_c" 1>&6
-echo "configure:15004: checking for libevent" >&5
+echo "configure:15006: checking for libevent" >&5
 
         if $PKG_CONFIG --exists "libevent" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_LIBEVENT_CFLAGS""... $ac_c" 1>&6
-echo "configure:15011: checking MOZ_LIBEVENT_CFLAGS" >&5
+echo "configure:15013: checking MOZ_LIBEVENT_CFLAGS" >&5
             MOZ_LIBEVENT_CFLAGS=`$PKG_CONFIG --cflags "libevent"`
             echo "$ac_t""$MOZ_LIBEVENT_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_LIBEVENT_LIBS""... $ac_c" 1>&6
-echo "configure:15016: checking MOZ_LIBEVENT_LIBS" >&5
+echo "configure:15018: checking MOZ_LIBEVENT_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_LIBEVENT_LIBS="`$PKG_CONFIG --libs \"libevent\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_LIBEVENT_LIBS" 1>&6
@@ -15049,12 +15051,12 @@ elif test -z "$MOZ_NATIVE_LIBEVENT"; the
     LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
        ac_safe=`echo "event.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for event.h""... $ac_c" 1>&6
-echo "configure:15053: checking for event.h" >&5
+echo "configure:15055: checking for event.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 15058 "configure"
+#line 15060 "configure"
 #include "confdefs.h"
 
 #include <event.h>
@@ -15062,7 +15064,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:15066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -15085,7 +15087,7 @@ fi
   fi
 
     echo $ac_n "checking for event_init in -levent""... $ac_c" 1>&6
-echo "configure:15089: checking for event_init in -levent" >&5
+echo "configure:15091: checking for event_init in -levent" >&5
 ac_lib_var=`echo event'_'event_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15093,7 +15095,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-levent  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15097 "configure"
+#line 15099 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15104,7 +15106,7 @@ int main() {
 event_init()
 ; return 0; }
 EOF
-if { (eval echo configure:15108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15187,7 +15189,7 @@ fi
 	# Extract the first word of "nss-config", so it can be a program name with args.
 set dummy nss-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:15191: checking for $ac_word" >&5
+echo "configure:15193: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NSS_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15222,7 +15224,7 @@ fi
 
 	min_nss_version=3.16.2
 	echo $ac_n "checking for NSS - version >= $min_nss_version""... $ac_c" 1>&6
-echo "configure:15226: checking for NSS - version >= $min_nss_version" >&5
+echo "configure:15228: checking for NSS - version >= $min_nss_version" >&5
 
 	no_nss=""
 	if test "$NSS_CONFIG" = "no"; then
@@ -15289,13 +15291,13 @@ fi
 
 
 echo $ac_n "checking for YASM assembler""... $ac_c" 1>&6
-echo "configure:15293: checking for YASM assembler" >&5
+echo "configure:15295: checking for YASM assembler" >&5
 for ac_prog in yasm
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:15299: checking for $ac_word" >&5
+echo "configure:15301: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YASM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15353,7 +15355,7 @@ if test -z "$JPEG_DIR" -o "$JPEG_DIR" =
     MOZ_NATIVE_JPEG=
 else
     echo $ac_n "checking for jpeg_destroy_compress in -ljpeg""... $ac_c" 1>&6
-echo "configure:15357: checking for jpeg_destroy_compress in -ljpeg" >&5
+echo "configure:15359: checking for jpeg_destroy_compress in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_destroy_compress | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15361,7 +15363,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ljpeg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15365 "configure"
+#line 15367 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15372,7 +15374,7 @@ int main() {
 jpeg_destroy_compress()
 ; return 0; }
 EOF
-if { (eval echo configure:15376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15397,7 +15399,7 @@ fi
 
 if test "$MOZ_NATIVE_JPEG" = 1; then
     cat > conftest.$ac_ext <<EOF
-#line 15401 "configure"
+#line 15403 "configure"
 #include "confdefs.h"
  #include <stdio.h>
                      #include <sys/types.h>
@@ -15412,7 +15414,7 @@ int main() {
                      
 ; return 0; }
 EOF
-if { (eval echo configure:15416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_NATIVE_JPEG=1
 else
@@ -15459,7 +15461,7 @@ if test -z "$MOZ_ZLIB_LIBS$MOZ_ZLIB_CFLA
         MOZ_NATIVE_ZLIB=
     else
         echo $ac_n "checking for gzread in -lz""... $ac_c" 1>&6
-echo "configure:15463: checking for gzread in -lz" >&5
+echo "configure:15465: checking for gzread in -lz" >&5
 ac_lib_var=`echo z'_'gzread | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15467,7 +15469,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15471 "configure"
+#line 15473 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15478,7 +15480,7 @@ int main() {
 gzread()
 ; return 0; }
 EOF
-if { (eval echo configure:15482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15502,7 +15504,7 @@ fi
         if test "$MOZ_NATIVE_ZLIB" = 1; then
             MOZZLIBNUM=`echo $MOZZLIB | awk -F. '{printf "0x%x\n", ((($1 * 16 + $2) * 16) + $3) * 16 + $4}'`
             cat > conftest.$ac_ext <<EOF
-#line 15506 "configure"
+#line 15508 "configure"
 #include "confdefs.h"
  #include <stdio.h>
                              #include <string.h>
@@ -15513,7 +15515,7 @@ int main() {
                              #endif 
 ; return 0; }
 EOF
-if { (eval echo configure:15517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_NATIVE_ZLIB=1
 else
@@ -15566,7 +15568,7 @@ if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no
     MOZ_NATIVE_BZ2=
 else
     echo $ac_n "checking for BZ2_bzread in -lbz2""... $ac_c" 1>&6
-echo "configure:15570: checking for BZ2_bzread in -lbz2" >&5
+echo "configure:15572: checking for BZ2_bzread in -lbz2" >&5
 ac_lib_var=`echo bz2'_'BZ2_bzread | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15574,7 +15576,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbz2  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15578 "configure"
+#line 15580 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15585,7 +15587,7 @@ int main() {
 BZ2_bzread()
 ; return 0; }
 EOF
-if { (eval echo configure:15589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15634,7 +15636,7 @@ if test -z "$PNG_DIR" -o "$PNG_DIR" = no
     MOZ_NATIVE_PNG=
 else
     echo $ac_n "checking for png_get_valid in -lpng""... $ac_c" 1>&6
-echo "configure:15638: checking for png_get_valid in -lpng" >&5
+echo "configure:15640: checking for png_get_valid in -lpng" >&5
 ac_lib_var=`echo png'_'png_get_valid | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15642,7 +15644,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpng  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15646 "configure"
+#line 15648 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15653,7 +15655,7 @@ int main() {
 png_get_valid()
 ; return 0; }
 EOF
-if { (eval echo configure:15657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15675,7 +15677,7 @@ else
 fi
 
     echo $ac_n "checking for png_get_acTL in -lpng""... $ac_c" 1>&6
-echo "configure:15679: checking for png_get_acTL in -lpng" >&5
+echo "configure:15681: checking for png_get_acTL in -lpng" >&5
 ac_lib_var=`echo png'_'png_get_acTL | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15683,7 +15685,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpng  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15687 "configure"
+#line 15689 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15694,7 +15696,7 @@ int main() {
 png_get_acTL()
 ; return 0; }
 EOF
-if { (eval echo configure:15698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -15728,7 +15730,7 @@ fi
 fi
 if test "$MOZ_NATIVE_PNG" = 1; then
     cat > conftest.$ac_ext <<EOF
-#line 15732 "configure"
+#line 15734 "configure"
 #include "confdefs.h"
  #include <stdio.h>
                      #include <sys/types.h>
@@ -15742,7 +15744,7 @@ int main() {
                      #endif 
 ; return 0; }
 EOF
-if { (eval echo configure:15746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_NATIVE_PNG=1
 else
@@ -15811,7 +15813,7 @@ if test -n "$MOZ_NATIVE_HUNSPELL"; then
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:15815: checking for $ac_word" >&5
+echo "configure:15817: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15855,19 +15857,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for hunspell""... $ac_c" 1>&6
-echo "configure:15859: checking for hunspell" >&5
+echo "configure:15861: checking for hunspell" >&5
 
         if $PKG_CONFIG --exists "hunspell" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_HUNSPELL_CFLAGS""... $ac_c" 1>&6
-echo "configure:15866: checking MOZ_HUNSPELL_CFLAGS" >&5
+echo "configure:15868: checking MOZ_HUNSPELL_CFLAGS" >&5
             MOZ_HUNSPELL_CFLAGS=`$PKG_CONFIG --cflags "hunspell"`
             echo "$ac_t""$MOZ_HUNSPELL_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_HUNSPELL_LIBS""... $ac_c" 1>&6
-echo "configure:15871: checking MOZ_HUNSPELL_LIBS" >&5
+echo "configure:15873: checking MOZ_HUNSPELL_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_HUNSPELL_LIBS="`$PKG_CONFIG --libs \"hunspell\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_HUNSPELL_LIBS" 1>&6
@@ -15925,7 +15927,7 @@ if test -n "$MOZ_NATIVE_FFI"; then
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:15929: checking for $ac_word" >&5
+echo "configure:15931: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15969,19 +15971,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for libffi > 3.0.9""... $ac_c" 1>&6
-echo "configure:15973: checking for libffi > 3.0.9" >&5
+echo "configure:15975: checking for libffi > 3.0.9" >&5
 
         if $PKG_CONFIG --exists "libffi > 3.0.9" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6
-echo "configure:15980: checking MOZ_FFI_CFLAGS" >&5
+echo "configure:15982: checking MOZ_FFI_CFLAGS" >&5
             MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi > 3.0.9"`
             echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6
-echo "configure:15985: checking MOZ_FFI_LIBS" >&5
+echo "configure:15987: checking MOZ_FFI_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi > 3.0.9\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_FFI_LIBS" 1>&6
@@ -16017,7 +16019,7 @@ echo "configure:15985: checking MOZ_FFI_
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:16021: checking for $ac_word" >&5
+echo "configure:16023: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -16061,19 +16063,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for libffi >= 3.0.9""... $ac_c" 1>&6
-echo "configure:16065: checking for libffi >= 3.0.9" >&5
+echo "configure:16067: checking for libffi >= 3.0.9" >&5
 
         if $PKG_CONFIG --exists "libffi >= 3.0.9" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6
-echo "configure:16072: checking MOZ_FFI_CFLAGS" >&5
+echo "configure:16074: checking MOZ_FFI_CFLAGS" >&5
             MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi >= 3.0.9"`
             echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6
-echo "configure:16077: checking MOZ_FFI_LIBS" >&5
+echo "configure:16079: checking MOZ_FFI_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi >= 3.0.9\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_FFI_LIBS" 1>&6
@@ -16151,6 +16153,7 @@ MOZ_FEEDS=1
 MOZ_WEBAPP_RUNTIME=
 MOZ_JSDEBUGGER=1
 MOZ_AUTH_EXTENSION=1
+MOZ_OGG=1
 MOZ_RAW=
 MOZ_VORBIS=
 MOZ_TREMOR=
@@ -16291,7 +16294,7 @@ fi
 
 
 echo $ac_n "checking for application to build""... $ac_c" 1>&6
-echo "configure:16295: checking for application to build" >&5
+echo "configure:16298: checking for application to build" >&5
 if test -z "$MOZ_BUILD_APP"; then
   echo "$ac_t""browser" 1>&6
   MOZ_BUILD_APP=browser
@@ -16360,7 +16363,7 @@ fi
 
 # Allow the application to influence configure with a confvars.sh script.
 echo $ac_n "checking if app-specific confvars.sh exists""... $ac_c" 1>&6
-echo "configure:16364: checking if app-specific confvars.sh exists" >&5
+echo "configure:16367: checking if app-specific confvars.sh exists" >&5
 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
   echo "$ac_t""${srcdir}/${MOZ_BUILD_APP}/confvars.sh" 1>&6
   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
@@ -16553,7 +16556,7 @@ EOF
     fi
 
                                         echo $ac_n "checking for android build-tools directory""... $ac_c" 1>&6
-echo "configure:16557: checking for android build-tools directory" >&5
+echo "configure:16560: checking for android build-tools directory" >&5
     android_build_tools=""
     for suffix in `ls "$android_sdk_root/build-tools" | sed -e "s,android-,999.," | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr`; do
         tools_directory=`echo "$android_sdk_root/build-tools/$suffix" | sed -e "s,999.,android-,"`
@@ -16593,7 +16596,7 @@ echo "configure:16557: checking for andr
      # Extract the first word of "zipalign", so it can be a program name with args.
 set dummy zipalign; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:16597: checking for $ac_word" >&5
+echo "configure:16600: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZIPALIGN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -16642,7 +16645,7 @@ fi
      # Extract the first word of "dx", so it can be a program name with args.
 set dummy dx; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:16646: checking for $ac_word" >&5
+echo "configure:16649: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_DX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -16691,7 +16694,7 @@ fi
      # Extract the first word of "aapt", so it can be a program name with args.
 set dummy aapt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:16695: checking for $ac_word" >&5
+echo "configure:16698: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AAPT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -16740,7 +16743,7 @@ fi
      # Extract the first word of "aidl", so it can be a program name with args.
 set dummy aidl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:16744: checking for $ac_word" >&5
+echo "configure:16747: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AIDL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -16789,7 +16792,7 @@ fi
      # Extract the first word of "adb", so it can be a program name with args.
 set dummy adb; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:16793: checking for $ac_word" >&5
+echo "configure:16796: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ADB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17143,7 +17146,7 @@ if test "$COMPILE_ENVIRONMENT"; then
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17147: checking for $ac_word" >&5
+echo "configure:17150: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17187,19 +17190,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES""... $ac_c" 1>&6
-echo "configure:17191: checking for gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5
+echo "configure:17194: checking for gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5
 
         if $PKG_CONFIG --exists "gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_GTK3_CFLAGS""... $ac_c" 1>&6
-echo "configure:17198: checking MOZ_GTK3_CFLAGS" >&5
+echo "configure:17201: checking MOZ_GTK3_CFLAGS" >&5
             MOZ_GTK3_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES"`
             echo "$ac_t""$MOZ_GTK3_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_GTK3_LIBS""... $ac_c" 1>&6
-echo "configure:17203: checking MOZ_GTK3_LIBS" >&5
+echo "configure:17206: checking MOZ_GTK3_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_GTK3_LIBS="`$PKG_CONFIG --libs \"gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_GTK3_LIBS" 1>&6
@@ -17240,7 +17243,7 @@ echo "configure:17203: checking MOZ_GTK3
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17244: checking for $ac_word" >&5
+echo "configure:17247: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17284,19 +17287,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES""... $ac_c" 1>&6
-echo "configure:17288: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5
+echo "configure:17291: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5
 
         if $PKG_CONFIG --exists "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_GTK2_CFLAGS""... $ac_c" 1>&6
-echo "configure:17295: checking MOZ_GTK2_CFLAGS" >&5
+echo "configure:17298: checking MOZ_GTK2_CFLAGS" >&5
             MOZ_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES"`
             echo "$ac_t""$MOZ_GTK2_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_GTK2_LIBS""... $ac_c" 1>&6
-echo "configure:17300: checking MOZ_GTK2_LIBS" >&5
+echo "configure:17303: checking MOZ_GTK2_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_GTK2_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_GTK2_LIBS" 1>&6
@@ -17378,7 +17381,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17382: checking for $ac_word" >&5
+echo "configure:17385: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17422,19 +17425,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION""... $ac_c" 1>&6
-echo "configure:17426: checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" >&5
+echo "configure:17429: checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" >&5
 
         if $PKG_CONFIG --exists "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_STARTUP_NOTIFICATION_CFLAGS""... $ac_c" 1>&6
-echo "configure:17433: checking MOZ_STARTUP_NOTIFICATION_CFLAGS" >&5
+echo "configure:17436: checking MOZ_STARTUP_NOTIFICATION_CFLAGS" >&5
             MOZ_STARTUP_NOTIFICATION_CFLAGS=`$PKG_CONFIG --cflags "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"`
             echo "$ac_t""$MOZ_STARTUP_NOTIFICATION_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_STARTUP_NOTIFICATION_LIBS""... $ac_c" 1>&6
-echo "configure:17438: checking MOZ_STARTUP_NOTIFICATION_LIBS" >&5
+echo "configure:17441: checking MOZ_STARTUP_NOTIFICATION_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_STARTUP_NOTIFICATION_LIBS="`$PKG_CONFIG --libs \"libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_STARTUP_NOTIFICATION_LIBS" 1>&6
@@ -17532,7 +17535,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17536: checking for $ac_word" >&5
+echo "configure:17539: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_QMAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17577,7 +17580,7 @@ test -n "$HOST_QMAKE" || HOST_QMAKE=""""
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17581: checking for $ac_word" >&5
+echo "configure:17584: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17621,19 +17624,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for Qt5Gui Qt5Network Qt5Core Qt5Quick""... $ac_c" 1>&6
-echo "configure:17625: checking for Qt5Gui Qt5Network Qt5Core Qt5Quick" >&5
+echo "configure:17628: checking for Qt5Gui Qt5Network Qt5Core Qt5Quick" >&5
 
         if $PKG_CONFIG --exists "Qt5Gui Qt5Network Qt5Core Qt5Quick" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_QT_CFLAGS""... $ac_c" 1>&6
-echo "configure:17632: checking MOZ_QT_CFLAGS" >&5
+echo "configure:17635: checking MOZ_QT_CFLAGS" >&5
             MOZ_QT_CFLAGS=`$PKG_CONFIG --cflags "Qt5Gui Qt5Network Qt5Core Qt5Quick"`
             echo "$ac_t""$MOZ_QT_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_QT_LIBS""... $ac_c" 1>&6
-echo "configure:17637: checking MOZ_QT_LIBS" >&5
+echo "configure:17640: checking MOZ_QT_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_QT_LIBS="`$PKG_CONFIG --libs \"Qt5Gui Qt5Network Qt5Core Qt5Quick\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_QT_LIBS" 1>&6
@@ -17673,7 +17676,7 @@ echo "configure:17637: checking MOZ_QT_L
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17677: checking for $ac_word" >&5
+echo "configure:17680: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17717,19 +17720,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for Qt5PrintSupport""... $ac_c" 1>&6
-echo "configure:17721: checking for Qt5PrintSupport" >&5
+echo "configure:17724: checking for Qt5PrintSupport" >&5
 
         if $PKG_CONFIG --exists "Qt5PrintSupport" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_QT_WIDGETS_CFLAGS""... $ac_c" 1>&6
-echo "configure:17728: checking MOZ_QT_WIDGETS_CFLAGS" >&5
+echo "configure:17731: checking MOZ_QT_WIDGETS_CFLAGS" >&5
             MOZ_QT_WIDGETS_CFLAGS=`$PKG_CONFIG --cflags "Qt5PrintSupport"`
             echo "$ac_t""$MOZ_QT_WIDGETS_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_QT_WIDGETS_LIBS""... $ac_c" 1>&6
-echo "configure:17733: checking MOZ_QT_WIDGETS_LIBS" >&5
+echo "configure:17736: checking MOZ_QT_WIDGETS_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_QT_WIDGETS_LIBS="`$PKG_CONFIG --libs \"Qt5PrintSupport\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_QT_WIDGETS_LIBS" 1>&6
@@ -17774,7 +17777,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17778: checking for $ac_word" >&5
+echo "configure:17781: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_MOC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17809,7 +17812,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17813: checking for $ac_word" >&5
+echo "configure:17816: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HOST_RCC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17882,7 +17885,7 @@ test -n "$HOST_RCC" || HOST_RCC=""""
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17886: checking for $ac_word" >&5
+echo "configure:17889: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17926,19 +17929,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for qmsystem2""... $ac_c" 1>&6
-echo "configure:17930: checking for qmsystem2" >&5
+echo "configure:17933: checking for qmsystem2" >&5
 
         if $PKG_CONFIG --exists "qmsystem2" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _QMSYSTEM2_CFLAGS""... $ac_c" 1>&6
-echo "configure:17937: checking _QMSYSTEM2_CFLAGS" >&5
+echo "configure:17940: checking _QMSYSTEM2_CFLAGS" >&5
             _QMSYSTEM2_CFLAGS=`$PKG_CONFIG --cflags "qmsystem2"`
             echo "$ac_t""$_QMSYSTEM2_CFLAGS" 1>&6
 
             echo $ac_n "checking _QMSYSTEM2_LIBS""... $ac_c" 1>&6
-echo "configure:17942: checking _QMSYSTEM2_LIBS" >&5
+echo "configure:17945: checking _QMSYSTEM2_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _QMSYSTEM2_LIBS="`$PKG_CONFIG --libs \"qmsystem2\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_QMSYSTEM2_LIBS" 1>&6
@@ -17988,7 +17991,7 @@ EOF
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:17992: checking for $ac_word" >&5
+echo "configure:17995: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18032,19 +18035,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for QtNetwork >= 4.7""... $ac_c" 1>&6
-echo "configure:18036: checking for QtNetwork >= 4.7" >&5
+echo "configure:18039: checking for QtNetwork >= 4.7" >&5
 
         if $PKG_CONFIG --exists "QtNetwork >= 4.7" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _QTNETWORK_CFLAGS""... $ac_c" 1>&6
-echo "configure:18043: checking _QTNETWORK_CFLAGS" >&5
+echo "configure:18046: checking _QTNETWORK_CFLAGS" >&5
             _QTNETWORK_CFLAGS=`$PKG_CONFIG --cflags "QtNetwork >= 4.7"`
             echo "$ac_t""$_QTNETWORK_CFLAGS" 1>&6
 
             echo $ac_n "checking _QTNETWORK_LIBS""... $ac_c" 1>&6
-echo "configure:18048: checking _QTNETWORK_LIBS" >&5
+echo "configure:18051: checking _QTNETWORK_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _QTNETWORK_LIBS="`$PKG_CONFIG --libs \"QtNetwork >= 4.7\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_QTNETWORK_LIBS" 1>&6
@@ -18092,7 +18095,7 @@ EOF
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18096: checking for $ac_word" >&5
+echo "configure:18099: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18136,19 +18139,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for QtSensors QtFeedback QtLocation""... $ac_c" 1>&6
-echo "configure:18140: checking for QtSensors QtFeedback QtLocation" >&5
+echo "configure:18143: checking for QtSensors QtFeedback QtLocation" >&5
 
         if $PKG_CONFIG --exists "QtSensors QtFeedback QtLocation" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _QTMOBILITY_CFLAGS""... $ac_c" 1>&6
-echo "configure:18147: checking _QTMOBILITY_CFLAGS" >&5
+echo "configure:18150: checking _QTMOBILITY_CFLAGS" >&5
             _QTMOBILITY_CFLAGS=`$PKG_CONFIG --cflags "QtSensors QtFeedback QtLocation"`
             echo "$ac_t""$_QTMOBILITY_CFLAGS" 1>&6
 
             echo $ac_n "checking _QTMOBILITY_LIBS""... $ac_c" 1>&6
-echo "configure:18152: checking _QTMOBILITY_LIBS" >&5
+echo "configure:18155: checking _QTMOBILITY_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _QTMOBILITY_LIBS="`$PKG_CONFIG --libs \"QtSensors QtFeedback QtLocation\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_QTMOBILITY_LIBS" 1>&6
@@ -18191,7 +18194,7 @@ EOF
        
     else
        echo $ac_n "checking for main in -lQtSensors""... $ac_c" 1>&6
-echo "configure:18195: checking for main in -lQtSensors" >&5
+echo "configure:18198: checking for main in -lQtSensors" >&5
 ac_lib_var=`echo QtSensors'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -18199,14 +18202,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lQtSensors  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 18203 "configure"
+#line 18206 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:18210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -18242,7 +18245,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18246: checking for $ac_word" >&5
+echo "configure:18249: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18286,19 +18289,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for Qt0Feedback""... $ac_c" 1>&6
-echo "configure:18290: checking for Qt0Feedback" >&5
+echo "configure:18293: checking for Qt0Feedback" >&5
 
         if $PKG_CONFIG --exists "Qt0Feedback" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _QT5FEEDBACK_CFLAGS""... $ac_c" 1>&6
-echo "configure:18297: checking _QT5FEEDBACK_CFLAGS" >&5
+echo "configure:18300: checking _QT5FEEDBACK_CFLAGS" >&5
             _QT5FEEDBACK_CFLAGS=`$PKG_CONFIG --cflags "Qt0Feedback"`
             echo "$ac_t""$_QT5FEEDBACK_CFLAGS" 1>&6
 
             echo $ac_n "checking _QT5FEEDBACK_LIBS""... $ac_c" 1>&6
-echo "configure:18302: checking _QT5FEEDBACK_LIBS" >&5
+echo "configure:18305: checking _QT5FEEDBACK_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _QT5FEEDBACK_LIBS="`$PKG_CONFIG --libs \"Qt0Feedback\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_QT5FEEDBACK_LIBS" 1>&6
@@ -18348,7 +18351,7 @@ EOF
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18352: checking for $ac_word" >&5
+echo "configure:18355: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18392,19 +18395,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for Qt5Positioning""... $ac_c" 1>&6
-echo "configure:18396: checking for Qt5Positioning" >&5
+echo "configure:18399: checking for Qt5Positioning" >&5
 
         if $PKG_CONFIG --exists "Qt5Positioning" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _QT5GEOPOSITION_CFLAGS""... $ac_c" 1>&6
-echo "configure:18403: checking _QT5GEOPOSITION_CFLAGS" >&5
+echo "configure:18406: checking _QT5GEOPOSITION_CFLAGS" >&5
             _QT5GEOPOSITION_CFLAGS=`$PKG_CONFIG --cflags "Qt5Positioning"`
             echo "$ac_t""$_QT5GEOPOSITION_CFLAGS" 1>&6
 
             echo $ac_n "checking _QT5GEOPOSITION_LIBS""... $ac_c" 1>&6
-echo "configure:18408: checking _QT5GEOPOSITION_LIBS" >&5
+echo "configure:18411: checking _QT5GEOPOSITION_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _QT5GEOPOSITION_LIBS="`$PKG_CONFIG --libs \"Qt5Positioning\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_QT5GEOPOSITION_LIBS" 1>&6
@@ -18465,7 +18468,7 @@ EOF
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18469: checking for $ac_word" >&5
+echo "configure:18472: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18509,19 +18512,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for contentaction-0.1""... $ac_c" 1>&6
-echo "configure:18513: checking for contentaction-0.1" >&5
+echo "configure:18516: checking for contentaction-0.1" >&5
 
         if $PKG_CONFIG --exists "contentaction-0.1" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking LIBCONTENTACTION_CFLAGS""... $ac_c" 1>&6
-echo "configure:18520: checking LIBCONTENTACTION_CFLAGS" >&5
+echo "configure:18523: checking LIBCONTENTACTION_CFLAGS" >&5
             LIBCONTENTACTION_CFLAGS=`$PKG_CONFIG --cflags "contentaction-0.1"`
             echo "$ac_t""$LIBCONTENTACTION_CFLAGS" 1>&6
 
             echo $ac_n "checking LIBCONTENTACTION_LIBS""... $ac_c" 1>&6
-echo "configure:18525: checking LIBCONTENTACTION_LIBS" >&5
+echo "configure:18528: checking LIBCONTENTACTION_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             LIBCONTENTACTION_LIBS="`$PKG_CONFIG --libs \"contentaction-0.1\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$LIBCONTENTACTION_LIBS" 1>&6
@@ -18679,7 +18682,7 @@ then
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18683: checking for $ac_word" >&5
+echo "configure:18686: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18723,19 +18726,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for pango >= $PANGO_VERSION""... $ac_c" 1>&6
-echo "configure:18727: checking for pango >= $PANGO_VERSION" >&5
+echo "configure:18730: checking for pango >= $PANGO_VERSION" >&5
 
         if $PKG_CONFIG --exists "pango >= $PANGO_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _PANGOCHK_CFLAGS""... $ac_c" 1>&6
-echo "configure:18734: checking _PANGOCHK_CFLAGS" >&5
+echo "configure:18737: checking _PANGOCHK_CFLAGS" >&5
             _PANGOCHK_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION"`
             echo "$ac_t""$_PANGOCHK_CFLAGS" 1>&6
 
             echo $ac_n "checking _PANGOCHK_LIBS""... $ac_c" 1>&6
-echo "configure:18739: checking _PANGOCHK_LIBS" >&5
+echo "configure:18742: checking _PANGOCHK_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _PANGOCHK_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_PANGOCHK_LIBS" 1>&6
@@ -18771,7 +18774,7 @@ echo "configure:18739: checking _PANGOCH
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18775: checking for $ac_word" >&5
+echo "configure:18778: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18815,19 +18818,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION""... $ac_c" 1>&6
-echo "configure:18819: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5
+echo "configure:18822: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5
 
         if $PKG_CONFIG --exists "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_PANGO_CFLAGS""... $ac_c" 1>&6
-echo "configure:18826: checking MOZ_PANGO_CFLAGS" >&5
+echo "configure:18829: checking MOZ_PANGO_CFLAGS" >&5
             MOZ_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"`
             echo "$ac_t""$MOZ_PANGO_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_PANGO_LIBS""... $ac_c" 1>&6
-echo "configure:18831: checking MOZ_PANGO_LIBS" >&5
+echo "configure:18834: checking MOZ_PANGO_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_PANGO_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_PANGO_LIBS" 1>&6
@@ -18890,7 +18893,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:18894: checking for $ac_word" >&5
+echo "configure:18897: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18934,19 +18937,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION""... $ac_c" 1>&6
-echo "configure:18938: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5
+echo "configure:18941: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5
 
         if $PKG_CONFIG --exists "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_GNOMEVFS_CFLAGS""... $ac_c" 1>&6
-echo "configure:18945: checking MOZ_GNOMEVFS_CFLAGS" >&5
+echo "configure:18948: checking MOZ_GNOMEVFS_CFLAGS" >&5
             MOZ_GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"`
             echo "$ac_t""$MOZ_GNOMEVFS_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_GNOMEVFS_LIBS""... $ac_c" 1>&6
-echo "configure:18950: checking MOZ_GNOMEVFS_LIBS" >&5
+echo "configure:18953: checking MOZ_GNOMEVFS_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_GNOMEVFS_LIBS="`$PKG_CONFIG --libs \"gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_GNOMEVFS_LIBS" 1>&6
@@ -19020,7 +19023,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19024: checking for $ac_word" >&5
+echo "configure:19027: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19064,19 +19067,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for gtk+-2.0 >= 2.14""... $ac_c" 1>&6
-echo "configure:19068: checking for gtk+-2.0 >= 2.14" >&5
+echo "configure:19071: checking for gtk+-2.0 >= 2.14" >&5
 
         if $PKG_CONFIG --exists "gtk+-2.0 >= 2.14" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking _GTKCHECK_CFLAGS""... $ac_c" 1>&6
-echo "configure:19075: checking _GTKCHECK_CFLAGS" >&5
+echo "configure:19078: checking _GTKCHECK_CFLAGS" >&5
             _GTKCHECK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.14"`
             echo "$ac_t""$_GTKCHECK_CFLAGS" 1>&6
 
             echo $ac_n "checking _GTKCHECK_LIBS""... $ac_c" 1>&6
-echo "configure:19080: checking _GTKCHECK_LIBS" >&5
+echo "configure:19083: checking _GTKCHECK_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             _GTKCHECK_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= 2.14\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$_GTKCHECK_LIBS" 1>&6
@@ -19112,7 +19115,7 @@ echo "configure:19080: checking _GTKCHEC
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19116: checking for $ac_word" >&5
+echo "configure:19119: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19156,19 +19159,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for gio-2.0 >= $GIO_VERSION""... $ac_c" 1>&6
-echo "configure:19160: checking for gio-2.0 >= $GIO_VERSION" >&5
+echo "configure:19163: checking for gio-2.0 >= $GIO_VERSION" >&5
 
         if $PKG_CONFIG --exists "gio-2.0 >= $GIO_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_GIO_CFLAGS""... $ac_c" 1>&6
-echo "configure:19167: checking MOZ_GIO_CFLAGS" >&5
+echo "configure:19170: checking MOZ_GIO_CFLAGS" >&5
             MOZ_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= $GIO_VERSION"`
             echo "$ac_t""$MOZ_GIO_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_GIO_LIBS""... $ac_c" 1>&6
-echo "configure:19172: checking MOZ_GIO_LIBS" >&5
+echo "configure:19175: checking MOZ_GIO_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_GIO_LIBS="`$PKG_CONFIG --libs \"gio-2.0 >= $GIO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_GIO_LIBS" 1>&6
@@ -19240,7 +19243,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19244: checking for $ac_word" >&5
+echo "configure:19247: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19284,19 +19287,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 ""... $ac_c" 1>&6
-echo "configure:19288: checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 " >&5
+echo "configure:19291: checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 " >&5
 
         if $PKG_CONFIG --exists "gconf-2.0 >= $GCONF_VERSION gobject-2.0 " ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_GCONF_CFLAGS""... $ac_c" 1>&6
-echo "configure:19295: checking MOZ_GCONF_CFLAGS" >&5
+echo "configure:19298: checking MOZ_GCONF_CFLAGS" >&5
             MOZ_GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= $GCONF_VERSION gobject-2.0 "`
             echo "$ac_t""$MOZ_GCONF_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_GCONF_LIBS""... $ac_c" 1>&6
-echo "configure:19300: checking MOZ_GCONF_LIBS" >&5
+echo "configure:19303: checking MOZ_GCONF_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_GCONF_LIBS="`$PKG_CONFIG --libs \"gconf-2.0 >= $GCONF_VERSION gobject-2.0 \" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_GCONF_LIBS" 1>&6
@@ -19377,7 +19380,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19381: checking for $ac_word" >&5
+echo "configure:19384: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19421,19 +19424,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for libproxy-1.0""... $ac_c" 1>&6
-echo "configure:19425: checking for libproxy-1.0" >&5
+echo "configure:19428: checking for libproxy-1.0" >&5
 
         if $PKG_CONFIG --exists "libproxy-1.0" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_LIBPROXY_CFLAGS""... $ac_c" 1>&6
-echo "configure:19432: checking MOZ_LIBPROXY_CFLAGS" >&5
+echo "configure:19435: checking MOZ_LIBPROXY_CFLAGS" >&5
             MOZ_LIBPROXY_CFLAGS=`$PKG_CONFIG --cflags "libproxy-1.0"`
             echo "$ac_t""$MOZ_LIBPROXY_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_LIBPROXY_LIBS""... $ac_c" 1>&6
-echo "configure:19437: checking MOZ_LIBPROXY_LIBS" >&5
+echo "configure:19440: checking MOZ_LIBPROXY_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_LIBPROXY_LIBS="`$PKG_CONFIG --libs \"libproxy-1.0\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_LIBPROXY_LIBS" 1>&6
@@ -19506,7 +19509,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19510: checking for $ac_word" >&5
+echo "configure:19513: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19550,19 +19553,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for libgnomeui-2.0 >= $GNOMEUI_VERSION""... $ac_c" 1>&6
-echo "configure:19554: checking for libgnomeui-2.0 >= $GNOMEUI_VERSION" >&5
+echo "configure:19557: checking for libgnomeui-2.0 >= $GNOMEUI_VERSION" >&5
 
         if $PKG_CONFIG --exists "libgnomeui-2.0 >= $GNOMEUI_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_GNOMEUI_CFLAGS""... $ac_c" 1>&6
-echo "configure:19561: checking MOZ_GNOMEUI_CFLAGS" >&5
+echo "configure:19564: checking MOZ_GNOMEUI_CFLAGS" >&5
             MOZ_GNOMEUI_CFLAGS=`$PKG_CONFIG --cflags "libgnomeui-2.0 >= $GNOMEUI_VERSION"`
             echo "$ac_t""$MOZ_GNOMEUI_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_GNOMEUI_LIBS""... $ac_c" 1>&6
-echo "configure:19566: checking MOZ_GNOMEUI_LIBS" >&5
+echo "configure:19569: checking MOZ_GNOMEUI_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_GNOMEUI_LIBS="`$PKG_CONFIG --libs \"libgnomeui-2.0 >= $GNOMEUI_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_GNOMEUI_LIBS" 1>&6
@@ -19641,7 +19644,7 @@ fi
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19645: checking for $ac_word" >&5
+echo "configure:19648: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19685,19 +19688,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for dbus-1 >= $DBUS_VERSION""... $ac_c" 1>&6
-echo "configure:19689: checking for dbus-1 >= $DBUS_VERSION" >&5
+echo "configure:19692: checking for dbus-1 >= $DBUS_VERSION" >&5
 
         if $PKG_CONFIG --exists "dbus-1 >= $DBUS_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_DBUS_CFLAGS""... $ac_c" 1>&6
-echo "configure:19696: checking MOZ_DBUS_CFLAGS" >&5
+echo "configure:19699: checking MOZ_DBUS_CFLAGS" >&5
             MOZ_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= $DBUS_VERSION"`
             echo "$ac_t""$MOZ_DBUS_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_DBUS_LIBS""... $ac_c" 1>&6
-echo "configure:19701: checking MOZ_DBUS_LIBS" >&5
+echo "configure:19704: checking MOZ_DBUS_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_DBUS_LIBS="`$PKG_CONFIG --libs \"dbus-1 >= $DBUS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_DBUS_LIBS" 1>&6
@@ -19732,7 +19735,7 @@ echo "configure:19701: checking MOZ_DBUS
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19736: checking for $ac_word" >&5
+echo "configure:19739: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19776,19 +19779,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for dbus-glib-1 >= $DBUS_VERSION""... $ac_c" 1>&6
-echo "configure:19780: checking for dbus-glib-1 >= $DBUS_VERSION" >&5
+echo "configure:19783: checking for dbus-glib-1 >= $DBUS_VERSION" >&5
 
         if $PKG_CONFIG --exists "dbus-glib-1 >= $DBUS_VERSION" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_DBUS_GLIB_CFLAGS""... $ac_c" 1>&6
-echo "configure:19787: checking MOZ_DBUS_GLIB_CFLAGS" >&5
+echo "configure:19790: checking MOZ_DBUS_GLIB_CFLAGS" >&5
             MOZ_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= $DBUS_VERSION"`
             echo "$ac_t""$MOZ_DBUS_GLIB_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_DBUS_GLIB_LIBS""... $ac_c" 1>&6
-echo "configure:19792: checking MOZ_DBUS_GLIB_LIBS" >&5
+echo "configure:19795: checking MOZ_DBUS_GLIB_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_DBUS_GLIB_LIBS="`$PKG_CONFIG --libs \"dbus-glib-1 >= $DBUS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_DBUS_GLIB_LIBS" 1>&6
@@ -20013,14 +20016,14 @@ if test -n "$MOZ_WEBRTC"; then
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 20017 "configure"
+#line 20020 "configure"
 #include "confdefs.h"
 #include <linux/ethtool.h>
 int main() {
  struct ethtool_cmd cmd; cmd.speed_hi = 0; 
 ; return 0; }
 EOF
-if { (eval echo configure:20024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1
 else
@@ -20191,25 +20194,47 @@ fi
 
 
 
-echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
-echo "configure:20196: checking __attribute__ ((aligned ())) support" >&5
+# Check whether --enable-ogg or --disable-ogg was given.
+if test "${enable_ogg+set}" = set; then
+  enableval="$enable_ogg"
+  if test "$enableval" = "no"; then
+    MOZ_OGG=
+  elif test "$enableval" = "yes"; then
+    MOZ_OGG=1
+  else
+    { echo "configure: error: Option, ogg, does not take an argument ($enableval)." 1>&2; echo "configure: error: Option, ogg, does not take an argument ($enableval)." 1>&5; exit 1; }
+  fi
+fi
+
+
+if test -n "$MOZ_OGG"; then
+    cat >> confdefs.pytmp <<\EOF
+    (''' MOZ_OGG ''', ' 1 ')
+EOF
+cat >> confdefs.h <<\EOF
+#define MOZ_OGG 1
+EOF
+
+
+        echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
+echo "configure:20221: checking __attribute__ ((aligned ())) support" >&5
 if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_attribute_aligned=0
-     CFLAGS_save="${CFLAGS}"
-     CFLAGS="${CFLAGS} -Werror"
-     for ac_cv_c_attr_align_try in 64 32 16 8; do
-       echo "trying $ac_cv_c_attr_align_try"
-       cat > conftest.$ac_ext <<EOF
-#line 20206 "configure"
+         CFLAGS_save="${CFLAGS}"
+         CFLAGS="${CFLAGS} -Werror"
+         for ac_cv_c_attr_align_try in 64 32 16 8; do
+           echo "trying $ac_cv_c_attr_align_try"
+           cat > conftest.$ac_ext <<EOF
+#line 20231 "configure"
 #include "confdefs.h"
 
 int main() {
 static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;
 ; return 0; }
 EOF
-if { (eval echo configure:20213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"
 else
@@ -20217,22 +20242,23 @@ else
   cat conftest.$ac_ext >&5
 fi
 rm -f conftest*
-       if test "$ac_cv_c_attribute_aligned" != 0; then
-         break;
-       fi
-     done
-       CFLAGS="${CFLAGS_save}"
+           if test "$ac_cv_c_attribute_aligned" != 0; then
+             break;
+           fi
+         done
+           CFLAGS="${CFLAGS_save}"
 fi
 
 echo "$ac_t""$ac_cv_c_attribute_aligned" 1>&6
-if test "${ac_cv_c_attribute_aligned}" != "0"; then
-  cat >> confdefs.pytmp <<EOF
+    if test "${ac_cv_c_attribute_aligned}" != "0"; then
+      cat >> confdefs.pytmp <<EOF
     (''' ATTRIBUTE_ALIGNED_MAX ''', r''' ${ac_cv_c_attribute_aligned} ''')
 EOF
 cat >> confdefs.h <<EOF
 #define ATTRIBUTE_ALIGNED_MAX ${ac_cv_c_attribute_aligned}
 EOF
 
+    fi
 fi
 
 # Check whether --enable-opus or --disable-opus was given.
@@ -20537,7 +20563,7 @@ EOF
     # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:20541: checking for $ac_word" >&5
+echo "configure:20567: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20581,19 +20607,19 @@ fi
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
         echo $ac_n "checking for vpx >= 1.3.0""... $ac_c" 1>&6
-echo "configure:20585: checking for vpx >= 1.3.0" >&5
+echo "configure:20611: checking for vpx >= 1.3.0" >&5
 
         if $PKG_CONFIG --exists "vpx >= 1.3.0" ; then
             echo "$ac_t""yes" 1>&6
             succeeded=yes
 
             echo $ac_n "checking MOZ_LIBVPX_CFLAGS""... $ac_c" 1>&6
-echo "configure:20592: checking MOZ_LIBVPX_CFLAGS" >&5
+echo "configure:20618: checking MOZ_LIBVPX_CFLAGS" >&5
             MOZ_LIBVPX_CFLAGS=`$PKG_CONFIG --cflags "vpx >= 1.3.0"`
             echo "$ac_t""$MOZ_LIBVPX_CFLAGS" 1>&6
 
             echo $ac_n "checking MOZ_LIBVPX_LIBS""... $ac_c" 1>&6
-echo "configure:20597: checking MOZ_LIBVPX_LIBS" >&5
+echo "configure:20623: checking MOZ_LIBVPX_LIBS" >&5
             ## Remove evil flags like -Wl,--export-dynamic
             MOZ_LIBVPX_LIBS="`$PKG_CONFIG --libs \"vpx >= 1.3.0\" |sed s/-Wl,--export-dynamic//g`"
             echo "$ac_t""$MOZ_LIBVPX_LIBS" 1>&6
@@ -20628,12 +20654,12 @@ echo "configure:20597: checking MOZ_LIBV
 
            ac_safe=`echo "vpx/vpx_decoder.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for vpx/vpx_decoder.h""... $ac_c" 1>&6
-echo "configure:20632: checking for vpx/vpx_decoder.h" >&5
+echo "configure:20658: checking for vpx/vpx_decoder.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 20637 "configure"
+#line 20663 "configure"
 #include "confdefs.h"
 
 #include <vpx/vpx_decoder.h>
@@ -20641,7 +20667,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -20663,7 +20689,7 @@ fi
 
 
         echo $ac_n "checking for vpx_codec_dec_init_ver in -lvpx""... $ac_c" 1>&6
-echo "configure:20667: checking for vpx_codec_dec_init_ver in -lvpx" >&5
+echo "configure:20693: checking for vpx_codec_dec_init_ver in -lvpx" >&5
 ac_lib_var=`echo vpx'_'vpx_codec_dec_init_ver | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -20671,7 +20697,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lvpx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20675 "configure"
+#line 20701 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -20682,7 +20708,7 @@ int main() {
 vpx_codec_dec_init_ver()
 ; return 0; }
 EOF
-if { (eval echo configure:20686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -20716,12 +20742,12 @@ fi
 
            ac_safe=`echo "vpx_mem/vpx_mem.h" | sed 'y%./+-%__p_%'`
   echo $ac_n "checking for vpx_mem/vpx_mem.h""... $ac_c" 1>&6
-echo "configure:20720: checking for vpx_mem/vpx_mem.h" >&5
+echo "configure:20746: checking for vpx_mem/vpx_mem.h" >&5
   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
    cat > conftest.$ac_ext <<EOF
-#line 20725 "configure"
+#line 20751 "configure"
 #include "confdefs.h"
 
 #include <vpx_mem/vpx_mem.h>
@@ -20729,7 +20755,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
@@ -20744,12 +20770,12 @@ fi
   if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
     echo "$ac_t""yes" 1>&6
     echo $ac_n "checking for vpx_mem_set_functions""... $ac_c" 1>&6
-echo "configure:20748: checking for vpx_mem_set_functions" >&5
+echo "configure:20774: checking for vpx_mem_set_functions" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vpx_mem_set_functions'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20753 "configure"
+#line 20779 "configure"
 #define vpx_mem_set_functions innocuous_vpx_mem_set_functions
 #include "confdefs.h"
 #undef vpx_mem_set_functions
@@ -20776,7 +20802,7 @@ vpx_mem_set_functions();
 
 ; return 0; }
 EOF
-if { (eval echo configure:20780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vpx_mem_set_functions=yes"
 else
@@ -20819,7 +20845,7 @@ fi
 
 
 
-if test "$MOZ_WEBM"; then
+if test "$MOZ_WEBM" -o "$MOZ_OGG"; then
     if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
         MOZ_VORBIS=1
     else
@@ -20933,6 +20959,16 @@ EOF
 fi
 
 
+if test -n "$MOZ_OPUS" -a -z "$MOZ_OGG"; then
+    { echo "configure: error: MOZ_OPUS requires MOZ_OGG which is disabled." 1>&2; echo "configure: error: MOZ_OPUS requires MOZ_OGG which is disabled." 1>&5; exit 1; }
+fi
+
+if test -n "$MOZ_VORBIS" -a -z "$MOZ_OGG"; then
+    { echo "configure: error: MOZ_VORBIS requires MOZ_OGG which is disabled.
+Note that you need vorbis support for WebM playback." 1>&2; echo "configure: error: MOZ_VORBIS requires MOZ_OGG which is disabled.
+Note that you need vorbis support for WebM playback." 1>&5; exit 1; }
+fi
+
 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
     { echo "configure: error: MOZ_VORBIS and MOZ_TREMOR are mutually exclusive!  The build system should not allow them both to be set, but they are.  Please file a bug at https://bugzilla.mozilla.org/" 1>&2; echo "configure: error: MOZ_VORBIS and MOZ_TREMOR are mutually exclusive!  The build system should not allow them both to be set, but they are.  Please file a bug at https://bugzilla.mozilla.org/" 1>&5; exit 1; }
 fi
@@ -27924,6 +27960,7 @@ EOF
 
 
 
+
 if test "$MOZ_DEBUG"; then
     MOZ_EM_DEBUG=1
 fi
@@ -28518,7 +28555,8 @@ rm confdefs.pytmp confdefs.h
 cat >> $CONFIG_STATUS <<\EOF
 ] ]
 
-substs = [(name[1:-1], value[1:-1] if isinstance(value, types.StringTypes) else value) for name, value in [
+substs = []
+mylist = [
 EOF
 
 sed 's/$/,/' >> $CONFIG_STATUS <<EOF
@@ -29193,6 +29231,7 @@ sed 's/$/,/' >> $CONFIG_STATUS <<EOF
     (''' MOZ_OMX_PLUGIN ''', r''' $MOZ_OMX_PLUGIN ''')
     (''' MOZ_VPX_ERROR_CONCEALMENT ''', r''' $MOZ_VPX_ERROR_CONCEALMENT ''')
     (''' MOZ_VPX ''', r''' $MOZ_VPX ''')
+    (''' MOZ_OGG ''', r''' $MOZ_OGG ''')
     (''' VPX_AS ''', r''' $VPX_AS ''')
     (''' VPX_ASFLAGS ''', r''' $VPX_ASFLAGS ''')
     (''' VPX_DASH_C_FLAG ''', r''' $VPX_DASH_C_FLAG ''')
@@ -29234,7 +29273,12 @@ for ac_subst_arg in $_subconfigure_ac_su
 done
 
 cat >> $CONFIG_STATUS <<\EOF
-] ]
+]
+for name, value in mylist:
+  if isinstance(value, types.StringTypes):
+    substs.append( (name[1:-1], value[1:-1]) )
+  else:
+    substs.append( (name[1:-1], value) )
 
 non_global_defines = [
 EOF
diff -up mozilla-esr31/content/canvas/test/webgl-conformance/writemanifest.py.python3 mozilla-esr31/content/canvas/test/webgl-conformance/writemanifest.py
--- mozilla-esr31/content/canvas/test/webgl-conformance/writemanifest.py.python3	2014-08-25 15:17:00.000000000 +0200
+++ mozilla-esr31/content/canvas/test/webgl-conformance/writemanifest.py	2014-09-05 15:26:14.058680943 +0200
@@ -25,8 +25,10 @@ def listfiles(dir, rel):
 def writemanifest():
     script_dir = os.path.dirname(__file__)
     list_dirs = [os.path.join(script_dir, d) for d in CONFORMANCE_DIRS]
-    with open(os.path.join(script_dir, 'mochitest-conformance-files.ini'), 'w') as f:
+    f = open(os.path.join(script_dir, 'mochitest-conformance-files.ini'), 'w')
+    if 1:
         f.write("""[DEFAULT]
+    f.close()
 support-files =
   %s
 """ % "\n  ".join(sorted(chain.from_iterable(listfiles(d, script_dir)
diff -up mozilla-esr31/dom/bindings/Codegen.py.python3 mozilla-esr31/dom/bindings/Codegen.py
--- mozilla-esr31/dom/bindings/Codegen.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/Codegen.py	2014-09-05 15:26:14.060680953 +0200
@@ -9,7 +9,8 @@ import re
 import string
 import math
 import textwrap
-
+from rhrebase import any
+from rhrebase import all
 from WebIDL import BuiltinTypes, IDLBuiltinType, IDLNullValue, IDLSequenceType, IDLType, IDLAttribute, IDLUndefinedValue
 from Configuration import NoSuchDescriptorError, getTypesFromDescriptor, getTypesFromDictionary, getTypesFromCallback, Descriptor
 
@@ -152,7 +153,7 @@ def fill(template, **args):
     return t.substitute(args)
 
 
-class CGThing():
+class CGThing:
     """
     Abstract base class for things that spit out code.
     """
@@ -276,8 +277,11 @@ class CGNativePropertyHooks(CGThing):
         else:
             prototypeID += "_ID_Count"
         parent = self.descriptor.interface.parent
-        parentHooks = (toBindingNamespace(parent.identifier.name) + "::sNativePropertyHooks"
-                       if parent else 'nullptr')
+        parentHooks = ""
+        if parent:
+          parentHooks = toBindingNamespace(parent.identifier.name) + "::sNativePropertyHooks"
+        else:
+          parentHooks = 'nullptr'
 
         return fill(
             """
@@ -300,12 +304,15 @@ class CGNativePropertyHooks(CGThing):
 
 
 def NativePropertyHooks(descriptor):
-    return "&sWorkerNativePropertyHooks" if descriptor.workers else "sNativePropertyHooks"
+    if descriptor.workers:
+      return "&sWorkerNativePropertyHooks"
+    else:
+      return "sNativePropertyHooks"
 
 
 def DOMClass(descriptor):
     def make_name(d):
-        return "%s%s" % (d.interface.identifier.name, '_workers' if d.workers else '')
+        return "%s%s" % (d.interface.identifier.name, ('', '_workers')[d.workers])
 
     protoList = ['prototypes::id::' + make_name(descriptor.getDescriptor(proto)) for proto in descriptor.prototypeChain]
     # Pad out the list to the right length with _ID_Count so we
@@ -343,7 +350,11 @@ class CGDOMJSClass(CGThing):
 
     def define(self):
         traceHook = 'nullptr'
-        callHook = LEGACYCALLER_HOOK_NAME if self.descriptor.operations["LegacyCaller"] else 'nullptr'
+        callHook = None
+        if self.descriptor.operations["LegacyCaller"]:
+          callHook = LEGACYCALLER_HOOK_NAME
+        else:
+          callHook = 'nullptr'
         slotCount = INSTANCE_RESERVED_SLOTS + self.descriptor.interface.totalMembersInSlots
         classFlags = "JSCLASS_IS_DOMJSCLASS | "
         classExtensionAndObjectOps = """\
@@ -426,7 +437,7 @@ JS_NULL_OBJECT_OPS
             """,
             name=self.descriptor.interface.identifier.name,
             flags=classFlags,
-            addProperty=ADDPROPERTY_HOOK_NAME if wantsAddProperty(self.descriptor) else 'JS_PropertyStub',
+            addProperty=('JS_PropertyStub', ADDPROPERTY_HOOK_NAME)[wantsAddProperty(self.descriptor)],
             enumerate=enumerateHook,
             resolve=newResolveHook,
             finalize=FINALIZE_HOOK_NAME,
@@ -454,7 +465,11 @@ class CGDOMProxyJSClass(CGThing):
         # HTMLAllCollection.  So just hardcode it here.
         if self.descriptor.interface.identifier.name == "HTMLAllCollection":
             flags.append("JSCLASS_EMULATES_UNDEFINED")
-        callHook = LEGACYCALLER_HOOK_NAME if self.descriptor.operations["LegacyCaller"] else 'nullptr'
+        callHook = None
+        if self.descriptor.operations["LegacyCaller"]:
+          callHook = LEGACYCALLER_HOOK_NAME
+        else:
+          callHook = 'nullptr'
         return fill(  # BOGUS extra blank line at the top
             """
 
@@ -689,7 +704,12 @@ class CGList(CGThing):
         self.children.extend(kids)
 
     def join(self, iterable):
-        return self.joiner.join(s for s in iterable if len(s) > 0)
+        l = []
+        for s in iterable:
+           if len(s) > 0:
+              l.append(s)
+        
+        return self.joiner.join(l)
 
     def declare(self):
         return self.join(child.declare() for child in self.children if child is not None)
@@ -840,9 +860,9 @@ class CGElseChain(CGThing):
 
 class CGTemplatedType(CGWrapper):
     def __init__(self, templateName, child, isConst=False, isReference=False):
-        const = "const " if isConst else ""
+        const = ("", "const ")[isConst]
         pre = "%s%s<" % (const, templateName)
-        ref = "&" if isReference else ""
+        ref = ("", "&")[isReference]
         post = ">%s" % ref
         CGWrapper.__init__(self, child, pre=pre, post=post)
 
@@ -1280,7 +1300,7 @@ def UnionConversions(descriptors, dictio
                       post="\n\n"))
 
 
-class Argument():
+class Argument:
     """
     A class for outputting the type and name of an argument
     """
@@ -1337,7 +1357,13 @@ class CGAbstractMethod(CGThing):
         self.templateArgs = templateArgs
 
     def _argstring(self, declare):
-        return ', '.join([a.declare() if declare else a.define() for a in self.args])
+        l = []
+        for a in self.args:
+          if declare:
+            l.append(a.declare())
+          else:
+            l.append(a.define())
+        return ', '.join(l)
 
     def _template(self):
         if self.templateArgs is None:
@@ -1353,7 +1379,7 @@ class CGAbstractMethod(CGThing):
         if self.static:
             decorators.append('static')
         decorators.append(self.returnType)
-        maybeNewline = " " if self.inline else "\n"
+        maybeNewline = ("\n", " ")[self.inline]
         return ' '.join(decorators) + maybeNewline
 
     def declare(self):
@@ -1365,7 +1391,10 @@ class CGAbstractMethod(CGThing):
         return self.definition_prologue(fromDeclare) + self.definition_body() + self.definition_epilogue()
 
     def define(self):
-        return "" if self.inline else self._define()
+        if self.inline:
+          return ""
+        else:
+          return self._define()
 
     def definition_prologue(self, fromDeclare):
         return "%s%s%s(%s)\n{\n" % (self._template(), self._decorators(),
@@ -2184,7 +2213,7 @@ class AttrDefiner(PropertyDefiner):
             return ""
 
         def flags(attr):
-            unforgeable = " | JSPROP_PERMANENT" if self.unforgeable else ""
+            unforgeable = ("", " | JSPROP_PERMANENT")[self.unforgeable]
             return ("JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS" +
                     unforgeable)
 
@@ -2265,7 +2294,7 @@ class ConstDefiner(PropertyDefiner):
             PropertyDefiner.getControllingCondition, specData, doIdArrays)
 
 
-class PropertyArrays():
+class PropertyArrays:
     def __init__(self, descriptor):
         self.staticMethods = MethodDefiner(descriptor, "StaticMethods",
                                            static=True)
@@ -2299,7 +2328,10 @@ class CGNativeProperties(CGList):
     def __init__(self, descriptor, properties):
         def generateNativeProperties(name, chrome):
             def check(p):
-                return p.hasChromeOnly() if chrome else p.hasNonChromeOnly()
+                if chrome:
+                  return p.hasChromeOnly()
+                else:
+                  return p.hasNonChromeOnly()
 
             nativeProps = []
             for array in properties.arrayNames():
@@ -2507,7 +2539,9 @@ class CGCreateInterfaceObjectsMethod(CGA
             chromeProperties = accessCheck + " ? &sChromeOnlyNativeProperties : nullptr"
         else:
             chromeProperties = "nullptr"
-
+        back_name = "nullptr"
+        if needInterfaceObject:
+           back_name =   '"' + self.descriptor.interface.identifier.name + '"'
         call = fill(
             """
             dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
@@ -2529,7 +2563,7 @@ class CGCreateInterfaceObjectsMethod(CGA
             domClass=domClass,
             properties=properties,
             chromeProperties=chromeProperties,
-            name='"' + self.descriptor.interface.identifier.name + '"' if needInterfaceObject else "nullptr")
+            name=back_name)
 
         if UseHolderForUnforgeable(self.descriptor):
             assert needInterfacePrototypeObject
@@ -2765,6 +2799,9 @@ def InitUnforgeablePropertiesOnObject(de
     """
     properties is a PropertyArrays instance
     """
+    retval = ""
+    if failureReturnValue:
+       retval = " " + failureReturnValue
     defineUnforgeables = fill(
         """
         if (!DefineUnforgeableAttributes(aCx, ${obj}, %s)) {
@@ -2772,7 +2809,7 @@ def InitUnforgeablePropertiesOnObject(de
         }
         """,
         obj=obj,
-        rv=" " + failureReturnValue if failureReturnValue else "")
+        rv=retval)
 
     unforgeableAttrs = properties.unforgeableAttrs
     unforgeables = []
@@ -3172,6 +3209,8 @@ numericSuffixes = {
     IDLType.Tags.double: ''
 }
 
+def isnan(f):
+  return str(float(f)) == "nan"
 
 def numericValue(t, v):
     if (t == IDLType.Tags.unrestricted_double or
@@ -3181,12 +3220,12 @@ def numericValue(t, v):
             return "mozilla::PositiveInfinity<%s>()" % typeName
         if v == float("-inf"):
             return "mozilla::NegativeInfinity<%s>()" % typeName
-        if math.isnan(v):
+        if isnan(v):
             return "mozilla::UnspecifiedNaN<%s>()" % typeName
     return "%s%s" % (v, numericSuffixes[t])
 
 
-class CastableObjectUnwrapper():
+class CastableObjectUnwrapper:
     """
     A class for unwrapping an object named by the "source" argument
     based on the passed-in descriptor and storing it in a variable
@@ -3315,7 +3354,7 @@ class CGCallbackTempRoot(CGGeneric):
         CGGeneric.__init__(self, define=define)
 
 
-class JSToNativeConversionInfo():
+class JSToNativeConversionInfo:
     """
     An object representing information about a JS-to-native conversion.
     """
@@ -3857,11 +3896,17 @@ def getJSToNativeConversionInfo(type, de
         if nullable:
             type = type.inner
 
-        unionArgumentObj = "${declName}" if isMember else "${holderName}"
+        unionArgumentObj = "${holderName}"
+        if isMember:
+          unionArgumentObj = "${declName}"
+        #unionArgumentObj = ("${holderName}", "${declName}")[isMember == true]
         if nullable:
             # If we're a member, we're a Nullable, which hasn't been told it has
             # a value.  Otherwise we're an already-constructed Maybe.
-            unionArgumentObj += ".SetValue()" if isMember else ".ref()"
+            if isMember:
+              unionArgumentObj += ".SetValue()"
+            else:
+              unionArgumentObj += ".ref()"
 
         memberTypes = type.flatMemberTypes
         names = []
@@ -3971,9 +4016,18 @@ def getJSToNativeConversionInfo(type, de
             templateBody = CGList([templateBody,
                                    CGIfWrapper(setDictionary, "!done")])
 
-        stringTypes = [t for t in memberTypes if t.isString() or t.isEnum()]
-        numericTypes = [t for t in memberTypes if t.isNumeric()]
-        booleanTypes = [t for t in memberTypes if t.isBoolean()]
+        stringTypes = []
+        for t in memberTypes:
+          if t.isString() or t.isEnum():
+            stringTypes.append(t)
+        numericTypes = []
+        for t in memberTypes:
+          if t.isNumeric():
+            numericTypes.append(t)
+        booleanTypes = []
+        for t in memberTypes:
+          if t.isBoolean():
+            booleanTypes.append(t)
         if stringTypes or numericTypes or booleanTypes:
             assert len(stringTypes) <= 1
             assert len(numericTypes) <= 1
@@ -4100,7 +4154,7 @@ def getJSToNativeConversionInfo(type, de
 
             if tag in numericSuffixes or tag is IDLType.Tags.bool:
                 defaultStr = getHandleDefault(defaultValue)
-                value = declLoc + (".Value()" if nullable else "")
+                value = declLoc + (("", ".Value()")[nullable])
                 default = CGGeneric("%s.RawSetAs%s() = %s;\n" %
                                     (value, defaultValue.type, defaultStr))
             else:
@@ -4836,17 +4890,19 @@ def instantiateJSToNativeConversion(info
 
     if checkForValue:
         if dealWithOptional:
+            bp_args = ""
+            if info.declArgs:
+              bp_args = getArgsCGThing(info.declArgs).define()
             declConstruct = CGIndenter(
                 CGGeneric("%s.Construct(%s);\n" %
-                          (originalDeclName,
-                           getArgsCGThing(info.declArgs).define() if
-                           info.declArgs else "")))
+                          (originalDeclName, bp_args)))
+            bp_holderArgs = ""
+            if info.holderArgs:
+              bp_holderArgs = getArgsCGThing(info.holderArgs).define()
             if holderType is not None:
                 holderConstruct = CGIndenter(
                     CGGeneric("%s.construct(%s);\n" %
-                              (originalHolderName,
-                               getArgsCGThing(info.holderArgs).define() if
-                               info.holderArgs else "")))
+                              (originalHolderName, bp_holderArgs)))
             else:
                 holderConstruct = None
         else:
@@ -4880,7 +4936,7 @@ def convertConstIDLValueToJSVal(value):
     if tag in [IDLType.Tags.int64, IDLType.Tags.uint64]:
         return "DOUBLE_TO_JSVAL(%s)" % numericValue(tag, value.value)
     if tag == IDLType.Tags.bool:
-        return "JSVAL_TRUE" if value.value else "JSVAL_FALSE"
+        return ("JSVAL_FALSE", "JSVAL_TRUE")[value.value]
     if tag in [IDLType.Tags.float, IDLType.Tags.double]:
         return "DOUBLE_TO_JSVAL(%s)" % (value.value)
     raise TypeError("Const value of unhandled type: %s" % value.type)
@@ -4940,7 +4996,7 @@ class CGArgumentConverter(CGThing):
             isEnforceRange=self.argument.enforceRange,
             isClamp=self.argument.clamp,
             lenientFloatCode=self.lenientFloatCode,
-            isMember="Variadic" if self.argument.variadic else False,
+            isMember=(False, "Variadic")[self.argument.variadic],
             allowTreatNonCallableAsNull=self.argument.allowTreatNonCallableAsNull(),
             sourceDescription=self.argDescription)
 
@@ -5904,7 +5960,10 @@ def wrapTypeIntoCurrentCompartment(type,
                 if memberWrap:
                     memberWraps.append(memberWrap)
             myDict = myDict.parent
-        return CGList(memberWraps) if len(memberWraps) != 0 else None
+        if len(memberWraps) != 0:
+          return CGList(memberWraps)
+        else:
+          return None
 
     if type.isUnion():
         memberWraps = []
@@ -5919,7 +5978,10 @@ def wrapTypeIntoCurrentCompartment(type,
                 memberWrap = CGIfWrapper(
                     memberWrap, "%s.Is%s()" % (value, memberName))
                 memberWraps.append(memberWrap)
-        return CGList(memberWraps, "else ") if len(memberWraps) != 0 else None
+        if len(memberWraps) != 0:
+          return CGList(memberWraps, "else ")
+        else:
+          return None
 
     if (type.isString() or type.isPrimitive() or type.isEnum() or
         type.isGeckoInterface() or type.isCallback() or type.isDate()):
@@ -6116,8 +6178,11 @@ class CGPerSignatureCall(CGThing):
                 CGIfWrapper(CGList(xraySteps),
                             "objIsXray"))
 
+        errRep = None
+        if self.isFallible():
+          errRep = self.getErrorReport()
         cgThings.append(CGCallGenerator(
-            self.getErrorReport() if self.isFallible() else None,
+            errRep,
             self.getArguments(), argsPre, returnType,
             self.extendedAttributes, descriptor, nativeMethodName,
             static, argsPost=argsPost))
@@ -6151,7 +6216,7 @@ class CGPerSignatureCall(CGThing):
             'jsvalHandle': 'args.rval()',
             'returnsNewObject': returnsNewObject,
             'successCode': successCode,
-            'obj': "reflector" if setSlot else "obj"
+            'obj': ("obj", "reflector")[setSlot]
         }
         try:
             wrapCode = wrapForType(self.returnType, self.descriptor, resultTemplateValues)
@@ -6490,18 +6555,16 @@ class CGMethodCall(CGThing):
             # First check for undefined and optional distinguishing arguments
             # and output a special branch for that case.  Note that we don't
             # use distinguishingArgument here because we actualy want to
-            # exclude variadic arguments.  Also note that we skip this check if
-            # we plan to output a isNullOrUndefined() special case for this
+            # exclude variadic arguments.  Also note that we skip this check if # we plan to output a isNullOrUndefined() special case for this
             # argument anyway, since that will subsume our isUndefined() check.
             # This is safe, because there can be at most one nullable
             # distinguishing argument, so if we're it we'll definitely get
             # picked up by the nullable handling.  Also, we can skip this check
             # if the argument has an unconditional conversion later on.
-            undefSigs = [s for s in possibleSignatures if
-                         distinguishingIndex < len(s[1]) and
-                         s[1][distinguishingIndex].optional and
-                         hasConditionalConversion(s[1][distinguishingIndex].type) and
-                         not needsNullOrUndefinedCase(s[1][distinguishingIndex].type)]
+            undefSigs = []
+            for s in possibleSignatures:
+              if distinguishingIndex < len(s[1]) and s[1][distinguishingIndex].optional and hasConditionalConversion(s[1][distinguishingIndex].type) and not needsNullOrUndefinedCase(s[1][distinguishingIndex].type):
+                 undefSigs.append(s)
             # Can't have multiple signatures with an optional argument at the
             # same index.
             assert len(undefSigs) < 2
@@ -6682,7 +6745,7 @@ class CGGetterCall(CGPerSignatureCall):
                                     getter=True)
 
 
-class FakeArgument():
+class FakeArgument:
     """
     A class that quacks like an IDLArgument.  This is used to make
     setters look like method calls or for special operations.
@@ -6701,7 +6764,7 @@ class FakeArgument():
             self.enforceRange = False
             self.clamp = False
 
-        class FakeIdentifier():
+        class FakeIdentifier:
             def __init__(self):
                 self.name = name
         self.identifier = FakeIdentifier()
@@ -6858,7 +6921,7 @@ class CGGenericMethod(CGAbstractBindingM
         unwrapFailureCode = (
             'return ThrowInvalidThis(cx, args, GetInvalidThisErrorForMethod(%%(securityError)s), "%s");\n' %
             descriptor.interface.identifier.name)
-        name = "genericCrossOriginMethod" if allowCrossOriginThis else "genericMethod"
+        name = ("genericMethod", "genericCrossOriginMethod")[allowCrossOriginThis]
         CGAbstractBindingMethod.__init__(self, descriptor, name,
                                          args,
                                          unwrapFailureCode=unwrapFailureCode,
@@ -7091,7 +7154,7 @@ class CGEnumerateHook(CGAbstractBindingM
         return prefix + CGAbstractBindingMethod.definition_body(self)
 
 
-class CppKeywords():
+class CppKeywords:
     """
     A class for checking if method names declared in webidl
     are not in conflict with C++ keywords.
@@ -7694,7 +7757,7 @@ class CGMemberJITInfo(CGThing):
             return "JSJitInfo::Object"
         if t.isUnion():
             u = t.unroll()
-            type = "JSJitInfo::Null" if u.hasNullableType else ""
+            type = ("", "JSJitInfo::Null")[u.hasNullableType]
             return ("JSJitInfo::ArgType(%s)" %
                     reduce(CGMemberJITInfo.getSingleArgType,
                            u.flatMemberTypes, type))
@@ -7921,18 +7984,18 @@ def getUnionTypeTemplateVars(unionType,
     # By the time tryNextCode is invoked, we're guaranteed the union has been
     # constructed as some type, since we've been trying to convert into the
     # corresponding member.
-    prefix = "" if ownsMembers else "mUnion."
+    prefix = ("mUnion.", "")[ownsMembers]
     tryNextCode = ("%sDestroy%s();\n"
                    "tryNext = true;\n"
                    "return true;\n" % (prefix, name))
     conversionInfo = getJSToNativeConversionInfo(
         type, descriptorProvider, failureCode=tryNextCode,
         isDefinitelyObject=not type.isDictionary(),
-        isMember=("OwningUnion" if ownsMembers else None),
+        isMember=((None, "OwningUnion")[ownsMembers]),
         sourceDescription="member of %s" % unionType)
 
     ctorNeedsCx = conversionInfo.declArgs == "cx"
-    ctorArgs = "cx" if ctorNeedsCx else ""
+    ctorArgs = ("", "cx")[ctorNeedsCx]
 
     # This is ugly, but UnionMember needs to call a constructor with no
     # arguments so the type can't be const.
@@ -7992,14 +8055,17 @@ def getUnionTypeTemplateVars(unionType,
                              bodyInHeader=not ownsMembers,
                              body=jsConversion)
 
+    holder = None
+    if conversionInfo.holderType:
+      holder = conversionInfo.holderType.define()
     return {
         "name": name,
         "structType": structType,
         "externalType": externalType,
         "setter": setter,
-        "holderType": conversionInfo.holderType.define() if conversionInfo.holderType else None,
+        "holderType": holder,
         "ctorArgs": ctorArgs,
-        "ctorArgList": [Argument("JSContext*", "cx")] if ctorNeedsCx else []
+        "ctorArgList": ([], [Argument("JSContext*", "cx")])[ctorNeedsCx]
     }
 
 
@@ -8218,8 +8284,16 @@ class CGUnionStruct(CGThing):
         else:
             disallowCopyConstruction = True
 
-        friend = "  friend class %sArgument;\n" % str(self.type) if not self.ownsMembers else ""
-        bases = [ClassBase("AllOwningUnionBase")] if self.ownsMembers else []
+        friend = None
+        if not self.ownsMembers:
+          friend = "  friend class %sArgument;\n" % str(self.type)
+        else:
+          friend = ""
+        bases = None
+        if self.ownsMembers:
+          bases = [ClassBase("AllOwningUnionBase")]
+        else:
+          bases = []
         return CGClass(selfName,
                        bases=bases,
                        members=members,
@@ -8257,7 +8331,10 @@ class CGUnionStruct(CGThing):
         Returns a string name for this known union type.
         """
         assert type.isUnion() and not type.nullable()
-        return ("Owning" if ownsMembers else "") + type.name
+        if ownsMembers:
+            return "Owning" + type.name
+        else:
+            return type.name
 
     @staticmethod
     def unionTypeDecl(type, ownsMembers):
@@ -8408,8 +8485,11 @@ class ClassMethod(ClassItem):
         return self.body
 
     def declare(self, cgClass):
-        templateClause = ('template <%s>\n' % ', '.join(self.templateArgs)
-                          if self.bodyInHeader and self.templateArgs else '')
+        templateClause = None
+        if self.bodyInHeader and self.templateArgs:
+          templateClause = ('template <%s>\n' % ', '.join(self.templateArgs))
+        else:
+          templateClause = ('')
         args = ', '.join([a.declare() for a in self.args])
         if self.bodyInHeader:
             body = indent(self.getBody())
@@ -8427,8 +8507,8 @@ class ClassMethod(ClassItem):
             breakAfterReturnDecl=self.breakAfterReturnDecl,
             name=self.name,
             args=args,
-            const=' const' if self.const else '',
-            override=' MOZ_OVERRIDE' if self.override else '',
+            const=('', ' const')[self.const],
+            override=('', ' MOZ_OVERRIDE')[self.override],
             body=body,
             breakAfterSelf=self.breakAfterSelf)
 
@@ -8462,7 +8542,7 @@ class ClassMethod(ClassItem):
             className=cgClass.getNameString(),
             name=self.name,
             args=', '.join([a.define() for a in self.args]),
-            const=' const' if self.const else '',
+            const=('', ' const')[self.const],
             body=self.getBody())
 
 
@@ -8653,7 +8733,7 @@ class ClassMember(ClassItem):
         ClassItem.__init__(self, name, visibility)
 
     def declare(self, cgClass):
-        return '%s%s %s;\n' % ('static ' if self.static else '', self.type,
+        return '%s%s %s;\n' % (('', 'static ')[self.static], self.type,
                                self.name)
 
     def define(self, cgClass):
@@ -8694,7 +8774,7 @@ class ClassEnum(ClassItem):
             else:
                 entry = '%s = %s' % (self.entries[i], self.values[i])
             entries.append(entry)
-        name = '' if not self.name else ' ' + self.name
+        name = (' ','')[not self.name] + self.name
         return 'enum%s\n{\n%s\n};\n' % (name, indent(',\n'.join(entries)))
 
     def define(self, cgClass):
@@ -8731,7 +8811,11 @@ class CGClass(CGThing):
         self.constructors = constructors
         # We store our single destructor in a list, since all of our
         # code wants lists of members.
-        self.destructors = [destructor] if destructor else []
+        self.destructors = None
+        if destructor:
+          self.destructors = [destructor]
+        else:
+          self.destructors = []
         self.methods = methods
         self.typedefs = typedefs
         self.enums = enums
@@ -8741,7 +8825,7 @@ class CGClass(CGThing):
         self.isStruct = isStruct
         self.disallowCopyConstruction = disallowCopyConstruction
         self.indent = indent
-        self.defaultVisibility = 'public' if isStruct else 'private'
+        self.defaultVisibility = ('private','public')[isStruct]
         self.decorators = decorators
         self.extradeclarations = extradeclarations
         self.extradefinitions = extradefinitions
@@ -8761,7 +8845,7 @@ class CGClass(CGThing):
             result += ('template <%s>\n' %
                        ','.join([str(a) for a in templateArgs]))
 
-        type = 'struct' if self.isStruct else 'class'
+        type = ('class', 'struct')[self.isStruct]
 
         if self.templateSpecialization:
             specialization = \
@@ -8998,7 +9082,7 @@ class CGClassForwardDeclare(CGThing):
         self.isStruct = isStruct
 
     def declare(self):
-        type = 'struct' if self.isStruct else 'class'
+        type = ('class', 'struct')[self.isStruct]
         return '%s %s;\n' % (type, self.name)
 
     def define(self):
@@ -10080,7 +10164,7 @@ class CGDOMJSProxyHandlerDefiner(CGThing
 
 
 def stripTrailingWhitespace(text):
-    tail = '\n' if text.endswith('\n') else ''
+    tail = ('', '\n')[text.endswith('\n')]
     lines = text.splitlines()
     return '\n'.join(line.rstrip() for line in lines) + tail
 
@@ -11007,8 +11091,10 @@ def dependencySortObjects(objects, depen
     while len(objects) != 0:
         # Find the dictionaries that don't depend on anything else
         # anymore and move them over.
-        toMove = [o for o in objects if
-                  len(dependencyGetter(o) & objects) == 0]
+        toMove = []
+        for o in objects:
+          if len(dependencyGetter(o) & objects) == 0:
+            toMove.append(o)
         if len(toMove) == 0:
             raise TypeError("Loop in dependency graph\n" +
                             "\n".join(o.location for o in objects))
@@ -11275,14 +11361,16 @@ class CGBindingRoot(CGThing):
         cgthings.extend([CGDescriptor(x) for x in descriptors])
 
         # Do codegen for all the callback interfaces.  Skip worker callbacks.
-        cgthings.extend([CGCallbackInterface(x) for x in callbackDescriptors if
-                         not x.workers])
+        cgthings.extend([CGCallbackInterface(x) for x in callbackDescriptors if not x.workers])
 
         # Do codegen for JS implemented classes
         def getParentDescriptor(desc):
             if not desc.interface.parent:
-                return set()
-            return {desc.getDescriptor(desc.interface.parent.identifier.name)}
+                return set()            
+            #return (desc.getDescriptor(desc.interface.parent.identifier.name))
+            s = set()
+            s.add(desc.getDescriptor(desc.interface.parent.identifier.name))
+            return s
         for x in dependencySortObjects(jsImplemented, getParentDescriptor,
                                        lambda d: d.interface.identifier.name):
             cgthings.append(CGCallbackInterface(x))
@@ -11365,7 +11453,7 @@ class CGNativeMember(ClassMethod):
         self.passJSBitsAsNeeded = passJSBitsAsNeeded
         self.jsObjectsArePtr = jsObjectsArePtr
         self.variadicIsSequence = variadicIsSequence
-        breakAfterSelf = "\n" if breakAfter else ""
+        breakAfterSelf = ("", "\n")[breakAfter]
         ClassMethod.__init__(self, name,
                              self.getReturnType(signature[0], False),
                              self.getArgs(signature[0], signature[1]),
@@ -11725,7 +11813,7 @@ class CGNativeMember(ClassMethod):
             decl = CGTemplatedType("Nullable", decl)
             ref = True
         if isMember == "Variadic":
-            arrayType = "Sequence" if self.variadicIsSequence else "nsTArray"
+            arrayType = ("nsTArray", "Sequence")[self.variadicIsSequence]
             decl = CGTemplatedType(arrayType, decl)
             ref = True
         elif optional:
@@ -11741,7 +11829,7 @@ class CGNativeMember(ClassMethod):
         """
         decl, ref = self.getArgType(arg.type,
                                     arg.optional and not arg.defaultValue,
-                                    "Variadic" if arg.variadic else False)
+                                    (False, "Variadic")[arg.variadic])
         if ref:
             decl = CGWrapper(decl, pre="const ", post="&")
 
@@ -12067,7 +12155,7 @@ class CGExampleClass(CGBindingImplClass)
         return string.Template(classImpl).substitute(
             ifaceName=self.descriptor.name,
             nativeType=self.nativeLeafName(self.descriptor),
-            parentType=self.nativeLeafName(self.parentDesc) if self.parentIface else "")
+            parentType=("", self.nativeLeafName(self.parentDesc))[self.parentIface])
 
     @staticmethod
     def nativeLeafName(descriptor):
@@ -12641,7 +12729,7 @@ class CGCallbackInterface(CGCallback):
                             methods, getters=getters, setters=setters)
 
 
-class FakeMember():
+class FakeMember:
     def __init__(self):
         self.treatNullAs = "Default"
 
@@ -12686,7 +12774,7 @@ class CallbackMember(CGNativeMember):
         self.needThisHandling = needThisHandling
         # If needThisHandling, we generate ourselves as private and the caller
         # will handle generating public versions that handle the "this" stuff.
-        visibility = "private" if needThisHandling else "public"
+        visibility = ("public", "private")[needThisHandling]
         self.rethrowContentException = rethrowContentException
         # We don't care, for callback codegen, whether our original member was
         # a method or attribute or whatnot.  Just always pass FakeMember()
@@ -12808,7 +12896,7 @@ class CallbackMember(CGNativeMember):
                 arg.type, self.descriptorProvider,
                 {
                     'result': result,
-                    'successCode': "continue;\n" if arg.variadic else "break;\n",
+                    'successCode': ("break;\n", "continue;\n")[arg.variadic],
                     'jsvalRef': "argv.handleAt(%s)" % jsvalIndex,
                     'jsvalHandle': "argv.handleAt(%s)" % jsvalIndex,
                     # XXXbz we don't have anything better to use for 'obj',
@@ -12818,7 +12906,7 @@ class CallbackMember(CGNativeMember):
                     'returnsNewObject': False,
                     'exceptionCode': self.exceptionCode
                 })
-        except MethodNotNewObjectError as err:
+        except MethodNotNewObjectError, err:
             raise TypeError("%s being passed as an argument to %s but is not "
                             "wrapper cached, so can't be reliably converted to "
                             "a JS object." %
@@ -12903,7 +12991,7 @@ class CallbackMember(CGNativeMember):
 
     @staticmethod
     def ensureASCIIName(idlObject):
-        type = "attribute" if idlObject.isAttr() else "operation"
+        type = ("operation", "attribute")[idlObject.isAttr()]
         if re.match("[^\x20-\x7E]", idlObject.identifier.name):
             raise SyntaxError('Callback %s name "%s" contains non-ASCII '
                               "characters.  We can't handle that.  %s" %
@@ -13126,7 +13214,7 @@ class CGJSImplInitOperation(CallbackOper
         return "__init"
 
 
-class GlobalGenRoots():
+class GlobalGenRoots:
     """
     Roots for global codegen.
 
@@ -13475,7 +13563,7 @@ class CGEventMethod(CGNativeMember):
     def getArg(self, arg):
         decl, ref = self.getArgType(arg.type,
                                     arg.optional and not arg.defaultValue,
-                                    "Variadic" if arg.variadic else False)
+                                    (False, "Variadic")[arg.variadic])
         if ref:
             decl = CGWrapper(decl, pre="const ", post="&")
 
@@ -13678,8 +13766,7 @@ class CGEventClass(CGBindingImplClass):
             dropJS += "mozilla::DropJSObjects(this);\n"
         # Just override CGClass and do our own thing
         nativeType = self.descriptor.nativeType.split('::')[-1]
-        ctorParams = ("aOwner, nullptr, nullptr" if self.parentType == "Event"
-                      else "aOwner")
+        ctorParams = (("aOwner", "aOwner, nullptr, nullptr")[self.parentType == "Event"])
 
         classImpl = fill(
             """
diff -up mozilla-esr31/dom/bindings/Configuration.py.python3 mozilla-esr31/dom/bindings/Configuration.py
--- mozilla-esr31/dom/bindings/Configuration.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/Configuration.py	2014-09-05 15:26:14.060680953 +0200
@@ -3,6 +3,7 @@
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from WebIDL import IDLInterface, IDLExternalInterface
+from rhrebase import any, all
 import os
 
 autogenerated_comment = "/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n"
@@ -95,8 +96,7 @@ class Configuration:
         (workerCallbacks, workerDictionaries) = findCallbacksAndDictionaries(workerTypes)
 
         self.dictionaries = [d for d in parseData if d.isDictionary()]
-        self.callbacks = [c for c in parseData if
-                          c.isCallback() and not c.isInterface()]
+        self.callbacks = [c for c in parseData if c.isCallback() and not c.isInterface()]
 
         def flagWorkerOrMainThread(items, main, worker):
             for item in items:
@@ -380,7 +380,10 @@ class Descriptor(DescriptorProvider):
                               desc.get('wrapperCache', True)))
 
         def make_name(name):
-            return name + "_workers" if self.workers else name
+            if self.workers:
+              return name + "_workers"
+            else:
+              return name
         self.name = make_name(interface.identifier.name)
 
         # self.extendedAttributes is a dict of dicts, keyed on
@@ -463,10 +466,10 @@ class Descriptor(DescriptorProvider):
 
         assert member.isAttr()
         assert bool(getter) != bool(setter)
-        key = 'getterOnly' if getter else 'setterOnly'
+        key = ('setterOnly', 'getterOnly')[getter]
         attrs = self.extendedAttributes['all'].get(name, []) + self.extendedAttributes[key].get(name, [])
         if throws is None:
-            throwsAttr = "GetterThrows" if getter else "SetterThrows"
+            throwsAttr = ("SetterThrows", "GetterThrows")[getter]
             throws = member.getExtendedAttribute(throwsAttr)
         maybeAppendInfallibleToAttrs(attrs, throws)
         return attrs
diff -up mozilla-esr31/dom/bindings/mach_commands.py.python3 mozilla-esr31/dom/bindings/mach_commands.py
--- mozilla-esr31/dom/bindings/mach_commands.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/mach_commands.py	2014-09-05 15:26:14.061680957 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import sys
diff -up mozilla-esr31/dom/bindings/mozwebidlcodegen/__init__.py.python3 mozilla-esr31/dom/bindings/mozwebidlcodegen/__init__.py
--- mozilla-esr31/dom/bindings/mozwebidlcodegen/__init__.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/mozwebidlcodegen/__init__.py	2014-09-05 15:26:14.061680957 +0200
@@ -5,11 +5,11 @@
 # This module contains code for managing WebIDL files and bindings for
 # the build system.
 
-from __future__ import unicode_literals
+
 
 import errno
-import hashlib
-import json
+import md5, sha
+import simplejson as json
 import logging
 import os
 
@@ -126,20 +126,20 @@ class WebIDLCodegenManager(LoggingMixin)
     """
 
     # Global parser derived declaration files.
-    GLOBAL_DECLARE_FILES = {
+    GLOBAL_DECLARE_FILES = [
         'GeneratedAtomList.h',
         'PrototypeList.h',
         'RegisterBindings.h',
         'UnionConversions.h',
         'UnionTypes.h',
-    }
+    ]
 
     # Global parser derived definition files.
-    GLOBAL_DEFINE_FILES = {
+    GLOBAL_DEFINE_FILES = [
         'RegisterBindings.cpp',
         'UnionTypes.cpp',
         'PrototypeList.cpp',
-    }
+    ]
 
     def __init__(self, config_path, inputs, exported_header_dir,
         codegen_dir, state_path, cache_dir=None, make_deps_path=None,
@@ -188,13 +188,15 @@ class WebIDLCodegenManager(LoggingMixin)
         self._state = WebIDLCodegenManagerState()
 
         if os.path.exists(state_path):
-            with open(state_path, 'rb') as fh:
+            fh = open(state_path, 'rb')
+            if 1:
                 try:
                     self._state = WebIDLCodegenManagerState(fh=fh)
-                except Exception as e:
+                except Exception, e:
                     self.log(logging.WARN, 'webidl_bad_state', {'msg': str(e)},
                         'Bad WebIDL state: {msg}')
 
+            fh.close()
     @property
     def config(self):
         if not self._config:
@@ -212,8 +214,7 @@ class WebIDLCodegenManager(LoggingMixin)
         are present and up to date.
 
         This routine is called as part of the build to ensure files that need
-        to exist are present and up to date. This routine may not be called if
-        the build dependencies (generated as a result of calling this the first
+        to exist are present and up to date. This routine may not be called if the build dependencies (generated as a result of calling this the first
         time) say everything is up to date.
 
         Because reprocessing outputs for every .webidl on every invocation
@@ -286,9 +287,11 @@ class WebIDLCodegenManager(LoggingMixin)
             codegen_rule.add_dependencies(global_hashes.keys())
             codegen_rule.add_dependencies(self._input_paths)
 
-            with FileAvoidWrite(self._make_deps_path) as fh:
+            fh = FileAvoidWrite(self._make_deps_path).__enter__()
+            if 1:
                 mk.dump(fh)
 
+            fh.__exit__(0, 0, 0)
         self._save_state()
 
         return result
@@ -313,11 +316,13 @@ class WebIDLCodegenManager(LoggingMixin)
         parser = WebIDL.Parser(self._cache_dir)
 
         for path in sorted(self._input_paths):
-            with open(path, 'rb') as fh:
+            fh = open(path, 'rb')
+            if 1:
                 data = fh.read()
-                hashes[path] = hashlib.sha1(data).hexdigest()
+                hashes[path] = sha.sha(data).hexdigest()
                 parser.parse(data, path)
 
+            fh.close()
         self._parser_results = parser.finish()
         self._config = Configuration(self._config_path, self._parser_results)
         self._input_hashes = hashes
@@ -363,8 +368,12 @@ class WebIDLCodegenManager(LoggingMixin)
         # a lot of extra work and most build systems don't do that anyway.
 
         # Now we move on to the input files.
-        old_hashes = {v['filename']: v['sha1']
-            for v in self._state['webidls'].values()}
+        old_hashes = {}
+        for v in self._state['webidls'].values():
+          old_hashes[v['filename']] = v['sha1']
+
+        #old_hashes = {v['filename']: v['sha1']
+        #    for v in self._state['webidls'].values()}
 
         old_filenames = set(old_hashes.keys())
         new_filenames = self._input_paths
@@ -416,11 +425,16 @@ class WebIDLCodegenManager(LoggingMixin)
 
         is_event = stem in self._generated_events_stems
 
+        my_header_dir = None
+        my_codegen_dir = None
+        if is_event:
+          my_header_dir = mozpath.join(header_dir, '%s.h' % stem)
+          my_codegen_dir = mozpath.join(self._codegen_dir, '%s.cpp' % stem)
         files = (
             mozpath.join(header_dir, '%s.h' % binding_stem),
             mozpath.join(self._codegen_dir, '%s.cpp' % binding_stem),
-            mozpath.join(header_dir, '%s.h' % stem) if is_event else None,
-            mozpath.join(self._codegen_dir, '%s.cpp' % stem) if is_event else None,
+            my_header_dir,
+            my_codegen_dir,
         )
 
         return stem, binding_stem, is_event, header_dir, files
@@ -442,7 +456,9 @@ class WebIDLCodegenManager(LoggingMixin)
 
         for p in self._input_paths:
             stem, binding_stem, is_event, header_dir, files = self._binding_info(p)
-            paths |= {f for f in files if f}
+            for f in files:
+               if f:
+                 paths.add(f);
 
         for interface in self._example_interfaces:
             for p in self._example_paths(interface):
@@ -484,11 +500,12 @@ class WebIDLCodegenManager(LoggingMixin)
 
         current_hashes = {}
         for f in current_files:
-            # This will fail if the file doesn't exist. If a current global
-            # dependency doesn't exist, something else is wrong.
-            with open(f, 'rb') as fh:
-                current_hashes[f] = hashlib.sha1(fh.read()).hexdigest()
+            # This will failthe file doesn't exist. If a current global # dependency doesn't exist, something = (is wrong., )[]
+            fh = open(f, 'rb')
+            if 1:
+                current_hashes[f] = sha.sha(fh.read()).hexdigest()
 
+            fh.close()
         # The set of files has changed.
         if current_files ^ set(self._state['global_depends'].keys()):
             return True, current_hashes
@@ -501,9 +518,11 @@ class WebIDLCodegenManager(LoggingMixin)
         return False, current_hashes
 
     def _save_state(self):
-        with open(self._state_path, 'wb') as fh:
+        fh = open(self._state_path, 'wb')
+        if 1:
             self._state.dump(fh)
 
+        fh.close()
     def _maybe_write_codegen(self, obj, declare_path, define_path, result=None):
         assert declare_path and define_path
         if not result:
@@ -532,16 +551,18 @@ def create_build_system_manager(topsrcdi
     src_dir = os.path.join(topsrcdir, 'dom', 'bindings')
     obj_dir = os.path.join(topobjdir, 'dom', 'bindings')
 
-    with open(os.path.join(obj_dir, 'file-lists.json'), 'rb') as fh:
+    fh = open(os.path.join(obj_dir, 'file-lists.json'), 'rb')
+    if 1:
         files = json.load(fh)
 
+    fh.close()
     inputs = (files['webidls'], files['exported_stems'],
         files['generated_events_stems'], files['example_interfaces'])
 
     cache_dir = os.path.join(obj_dir, '_cache')
     try:
         os.makedirs(cache_dir)
-    except OSError as e:
+    except OSError, e:
         if e.errno != errno.EEXIST:
             raise
 
diff -up mozilla-esr31/dom/bindings/mozwebidlcodegen/test/test_mozwebidlcodegen.py.python3 mozilla-esr31/dom/bindings/mozwebidlcodegen/test/test_mozwebidlcodegen.py
--- mozilla-esr31/dom/bindings/mozwebidlcodegen/test/test_mozwebidlcodegen.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/mozwebidlcodegen/test/test_mozwebidlcodegen.py	2014-09-05 15:26:14.061680957 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import imp
 import json
@@ -89,12 +89,14 @@ class TestWebIDLCodegenManager(unittest.
 
         p = args['state_path']
 
-        with open(p, 'wb') as fh:
+        fh = open(p, 'wb')
+        if 1:
             json.dump({
                 'version': WebIDLCodegenManagerState.VERSION + 1,
                 'foobar': '1',
             }, fh)
 
+        fh.close()
         manager = WebIDLCodegenManager(**args)
 
         self.assertEqual(manager._state['version'],
@@ -129,7 +131,8 @@ class TestWebIDLCodegenManager(unittest.
 
         self.assertTrue(os.path.isfile(manager._state_path))
 
-        with open(manager._state_path, 'rb') as fh:
+        fh = open(manager._state_path, 'rb')
+        if 1:
             state = json.load(fh)
             self.assertEqual(state['version'], 1)
             self.assertIn('webidls', state)
@@ -139,6 +142,7 @@ class TestWebIDLCodegenManager(unittest.
             self.assertEqual(len(child['outputs']), 2)
             self.assertEqual(child['sha1'], 'c41527cad3bc161fa6e7909e48fa11f9eca0468b')
 
+        fh.close()
     def test_generate_build_files_load_state(self):
         """State should be equivalent when instantiating a new instance."""
         args = self._get_manager_args()
@@ -197,13 +201,15 @@ class TestWebIDLCodegenManager(unittest.
         self.assertIsNotNone(child_path)
         child_content = open(child_path, 'rb').read()
 
-        with MockedOpen({child_path: child_content + '\n/* */'}):
+        MockedOpen({child_path: child_content + '\n/* */'}).__enter__()
+        if 1:
             m2 = WebIDLCodegenManager(**args)
             result = m2.generate_build_files()
             self.assertEqual(result.inputs, set([child_path]))
             self.assertEqual(len(result.updated), 0)
             self.assertEqual(len(result.created), 0)
 
+        MockedOpen({child_path: child_content + '\n/* */'}).__exit__(0, 0, 0)
     def test_rebuild_dependencies(self):
         """Ensure an input file used by others results in others rebuilding."""
         args = self._get_manager_args()
@@ -221,13 +227,15 @@ class TestWebIDLCodegenManager(unittest.
         self.assertIsNotNone(parent_path)
         parent_content = open(parent_path, 'rb').read()
 
-        with MockedOpen({parent_path: parent_content + '\n/* */'}):
+        MockedOpen({parent_path: parent_content + '\n/* */'}).__enter__()
+        if 1:
             m2 = WebIDLCodegenManager(**args)
             result = m2.generate_build_files()
             self.assertEqual(result.inputs, {child_path, parent_path})
             self.assertEqual(len(result.updated), 0)
             self.assertEqual(len(result.created), 0)
 
+        MockedOpen({parent_path: parent_content + '\n/* */'}).__exit__(0, 0, 0)
     def test_python_change_regenerate_everything(self):
         """If a Python file changes, we should attempt to rebuild everything."""
 
@@ -240,7 +248,8 @@ class TestWebIDLCodegenManager(unittest.
         # the first iteration we read from a temp file. The second iteration
         # doesn't need to import, so we are fine with a mocked file.
         fake_path = mozpath.join(OUR_DIR, 'fakemodule.py')
-        with NamedTemporaryFile('wt') as fh:
+        fh = NamedTemporaryFile('wt').__enter__()
+        if 1:
             fh.write('# Original content')
             fh.flush()
             mod = imp.load_source('mozwebidlcodegen.fakemodule', fh.name)
@@ -248,7 +257,8 @@ class TestWebIDLCodegenManager(unittest.
 
             args = self._get_manager_args()
             m1 = WebIDLCodegenManager(**args)
-            with MockedOpen({fake_path: '# Original content'}):
+            MockedOpen({fake_path: '# Original content'}).__enter__()
+            if 1:
                 old_exists = os.path.exists
                 try:
                     def exists(p):
@@ -274,6 +284,8 @@ class TestWebIDLCodegenManager(unittest.
                     os.path.exists = old_exists
                     del sys.modules['mozwebidlcodegen.fakemodule']
 
+            MockedOpen({fake_path: '# Original content'}).__exit__(0, 0, 0)
+        fh.close()
     def test_copy_input(self):
         """Ensure a copied .webidl file is handled properly."""
 
diff -up mozilla-esr31/dom/bindings/parser/tests/test_distinguishability.py.python3 mozilla-esr31/dom/bindings/parser/tests/test_distinguishability.py
--- mozilla-esr31/dom/bindings/parser/tests/test_distinguishability.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/parser/tests/test_distinguishability.py	2014-09-05 15:26:14.061680957 +0200
@@ -89,11 +89,11 @@ def WebIDLTest(parser, harness):
             harness.check(type1.isDistinguishableFrom(type2),
                           distinguishable,
                           "Type %s should %sbe distinguishable from type %s" %
-                          (type1, "" if distinguishable else "not ", type2))
+                          (type1, ("not ", "")[distinguishable], type2))
             harness.check(type2.isDistinguishableFrom(type1),
                           distinguishable,
                           "Type %s should %sbe distinguishable from type %s" %
-                          (type2, "" if distinguishable else "not ", type1))
+                          (type2, ("not ", "")[distinguishable], type1))
 
     parser = parser.reset()
     parser.parse("""
diff -up mozilla-esr31/dom/bindings/parser/tests/test_float_types.py.python3 mozilla-esr31/dom/bindings/parser/tests/test_float_types.py
--- mozilla-esr31/dom/bindings/parser/tests/test_float_types.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/parser/tests/test_float_types.py	2014-09-05 15:26:14.061680957 +0200
@@ -57,7 +57,7 @@ def WebIDLTest(parser, harness):
         harness.ok(type.isFloat(), "Type %d should be float" % idx)
         harness.check(type.isUnrestricted(), idx >= 5,
                       "Type %d should %sbe unrestricted" % (
-                idx, "" if idx >= 4 else "not "))
+                idx, ("not ","")[idx >= 4]))
 
     parser = parser.reset()
     threw = False
diff -up mozilla-esr31/dom/bindings/parser/WebIDL.py.python3 mozilla-esr31/dom/bindings/parser/WebIDL.py
--- mozilla-esr31/dom/bindings/parser/WebIDL.py.python3	2014-08-25 15:17:02.000000000 +0200
+++ mozilla-esr31/dom/bindings/parser/WebIDL.py	2014-09-05 15:26:14.062680962 +0200
@@ -9,6 +9,7 @@ import re
 import os
 import traceback
 import math
+from rhrebase import any, all
 
 # Machinery
 
@@ -69,7 +70,7 @@ class WebIDLError(Exception):
     def __str__(self):
         return "%s: %s%s%s" % (self.warning and 'warning' or 'error',
                                  self.message,
-                                 ", " if len(self.locations) != 0 else "",
+                                 ("", ", ")[len(self.locations) != 0],
                                  "\n".join(self.locations))
 
 class Location(object):
@@ -78,7 +79,11 @@ class Location(object):
         self._lineno = lineno
         self._lexpos = lexpos
         self._lexdata = lexer.lexdata
-        self._file = filename if filename else "<unknown>"
+        self._file = None
+        if filename:
+          self._file = filename
+        else:
+          self._file = "<unknown>"
 
     def __eq__(self, other):
         return self._lexpos == other._lexpos and \
@@ -551,7 +556,11 @@ class IDLInterface(IDLObjectWithScope):
                               [self.location])
 
         assert not self.parent or isinstance(self.parent, IDLIdentifierPlaceholder)
-        parent = self.parent.finish(scope) if self.parent else None
+        parent = None
+        if self.parent:
+          parent = self.parent.finish(scope)
+        else:
+          parent = None
         if parent and isinstance(parent, IDLExternalInterface):
             raise WebIDLError("%s inherits from %s which does not have "
                               "a definition" %
@@ -561,8 +570,8 @@ class IDLInterface(IDLObjectWithScope):
         assert not parent or isinstance(parent, IDLInterface)
 
         self.parent = parent
-
-        assert iter(self.members)
+        #print "SELF_MEMB", self.members 
+        # we may ignore it, empty array is also iterable in python 2.6 assert iter(self.members)
 
         if self.parent:
             self.parent.finish(scope)
@@ -685,11 +694,9 @@ class IDLInterface(IDLObjectWithScope):
             # worry about anything other than our parent, because it has already
             # imported its ancestors unforgeable attributes into its member
             # list.
-            for unforgeableAttr in (attr for attr in self.parent.members if
-                                    attr.isAttr() and not attr.isStatic() and
+            for unforgeableAttr in (attr for attr in self.parent.members if attr.isAttr() and not attr.isStatic() and
                                     attr.isUnforgeable()):
-                shadows = [ m for m in self.members if
-                            (m.isAttr() or m.isMethod()) and
+                shadows = [ m for m in self.members if (m.isAttr() or m.isMethod()) and
                             not m.isStatic() and
                             m.identifier.name == unforgeableAttr.identifier.name ]
                 if len(shadows) != 0:
@@ -853,8 +860,7 @@ class IDLInterface(IDLObjectWithScope):
             not any(m.isAttr() for m in self.members) and
             # There is at least one regular operation, and all regular
             # operations have the same identifier
-            len(set(m.identifier.name for m in self.members if
-                    m.isMethod() and not m.isStatic())) == 1)
+            len(set(m.identifier.name for m in self.members if m.isMethod() and not m.isStatic())) == 1)
 
     def inheritanceDepth(self):
         depth = 0
@@ -910,7 +916,11 @@ class IDLInterface(IDLObjectWithScope):
                     raise WebIDLError(str(identifier) + " and NoInterfaceObject are incompatible",
                                       [self.location])
 
-                args = attr.args() if attr.hasArgs() else []
+                args = None
+                if attr.hasArgs():
+                  args = attr.args()
+                else:
+                  args = []
 
                 retType = IDLWrapperType(self.location, self)
                 
@@ -995,7 +1005,8 @@ class IDLInterface(IDLObjectWithScope):
                                   [attr.location])
 
             attrlist = attr.listValue()
-            self._extendedAttrDict[identifier] = attrlist if len(attrlist) else True
+
+            self._extendedAttrDict[identifier] = (True, attrlist)[len(attrlist) > 0]
 
     def addImplementedInterface(self, implementedInterface):
         assert(isinstance(implementedInterface, IDLInterface))
@@ -2666,7 +2677,7 @@ class IDLInterfaceMember(IDLObjectWithId
         for attr in attrs:
             self.handleExtendedAttribute(attr)
             attrlist = attr.listValue()
-            self._extendedAttrDict[attr.identifier()] = attrlist if len(attrlist) else True
+            self._extendedAttrDict[attr.identifier()] = (True, attrlist)[len(attrlist)]
 
     def handleExtendedAttribute(self, attr):
         pass
@@ -3420,8 +3431,7 @@ class IDLMethod(IDLInterfaceMember, IDLS
                             [self.location, overload.location])
 
     def overloadsForArgCount(self, argc):
-        return [overload for overload in self._overloads if
-                len(overload.arguments) == argc or
+        return [overload for overload in self._overloads if len(overload.arguments) == argc or
                 (len(overload.arguments) > argc and
                  all(arg.optional for arg in overload.arguments[argc:])) or
                 (len(overload.arguments) < argc and
@@ -3890,7 +3900,10 @@ class Parser(Tokenizer):
         """
             InterfaceMembers : ExtendedAttributeList InterfaceMember InterfaceMembers
         """
-        p[0] = [p[2]] if p[2] else []
+        if p[2]:
+          p[0] = [p[2]]
+        else:
+          p[0] = []
 
         assert not p[1] or p[2]
         p[2].addExtendedAttributes(p[1])
@@ -4183,11 +4196,27 @@ class Parser(Tokenizer):
         # by the parser, so we can assert here.
         assert not stringifier or len(qualifiers) == 1
 
-        getter = True if IDLMethod.Special.Getter in p[1] else False
-        setter = True if IDLMethod.Special.Setter in p[1] else False
-        creator = True if IDLMethod.Special.Creator in p[1] else False
-        deleter = True if IDLMethod.Special.Deleter in p[1] else False
-        legacycaller = True if IDLMethod.Special.LegacyCaller in p[1] else False
+        getter = False
+        if IDLMethod.Special.Getter in p[1]:
+          getter = True
+        else:
+          getter = False
+        setter = False
+        if IDLMethod.Special.Setter in p[1]:
+          setter = True
+        creator = None
+        if IDLMethod.Special.Creator in p[1]:
+          creator = True
+        else:
+          creator = False
+        deleter = False
+        if IDLMethod.Special.Deleter in p[1]:
+          deleter = True
+        legacycaller = None
+        if IDLMethod.Special.LegacyCaller in p[1]:
+          legacycaller = True
+        else:
+          legacycaller = False
 
         if getter or deleter:
             if setter or creator:
@@ -4203,7 +4232,7 @@ class Parser(Tokenizer):
         if getter or deleter:
             if len(arguments) != 1:
                 raise WebIDLError("%s has wrong number of arguments" %
-                                  ("getter" if getter else "deleter"),
+                                  (("deleter", "getter")[getter]),
                                   [self.getLocation(p, 2)])
             argType = arguments[0].type
             if argType == BuiltinTypes[IDLBuiltinType.Types.domstring]:
@@ -4212,12 +4241,11 @@ class Parser(Tokenizer):
                 specialType = IDLMethod.NamedOrIndexed.Indexed
             else:
                 raise WebIDLError("%s has wrong argument type (must be DOMString or UnsignedLong)" %
-                                  ("getter" if getter else "deleter"),
+                                  (("deleter", "getter")[getter]),
                                   [arguments[0].location])
             if arguments[0].optional or arguments[0].variadic:
                 raise WebIDLError("%s cannot have %s argument" %
-                                  ("getter" if getter else "deleter",
-                                   "optional" if arguments[0].optional else "variadic"),
+                                  (("deleter", "getter")[getter], ("variadic", "optional")[garguments[0].optional]),
                                    [arguments[0].location])
         if getter:
             if returnType.isVoid():
@@ -4226,7 +4254,7 @@ class Parser(Tokenizer):
         if setter or creator:
             if len(arguments) != 2:
                 raise WebIDLError("%s has wrong number of arguments" %
-                                  ("setter" if setter else "creator"),
+                                  (("creator", "setter")[setter]),
                                   [self.getLocation(p, 2)])
             argType = arguments[0].type
             if argType == BuiltinTypes[IDLBuiltinType.Types.domstring]:
@@ -4235,17 +4263,15 @@ class Parser(Tokenizer):
                 specialType = IDLMethod.NamedOrIndexed.Indexed
             else:
                 raise WebIDLError("%s has wrong argument type (must be DOMString or UnsignedLong)" %
-                                  ("setter" if setter else "creator"),
+                                  (("creator", "setter")[setter]),
                                   [arguments[0].location])
             if arguments[0].optional or arguments[0].variadic:
                 raise WebIDLError("%s cannot have %s argument" %
-                                  ("setter" if setter else "creator",
-                                   "optional" if arguments[0].optional else "variadic"),
+                                  (("creator", "setter")[setter], ("variadic", "optional")[arguments[0].optional]),
                                   [arguments[0].location])
             if arguments[1].optional or arguments[1].variadic:
                 raise WebIDLError("%s cannot have %s argument" %
-                                  ("setter" if setter else "creator",
-                                   "optional" if arguments[1].optional else "variadic"),
+                                  (("creator", "setter")[setter], ("variadic", "optional")[arguments[1].optional]),
                                   [arguments[1].location])
 
         if stringifier:
@@ -4264,15 +4290,21 @@ class Parser(Tokenizer):
                                   [self.getLocation(p, 2)])
 
             location = BuiltinLocation("<auto-generated-identifier>")
+            first_parm = ""
+            if specialType == IDLMethod.NamedOrIndexed.Named:
+              first_parm = "named"
+            elif specialType == IDLMethod.NamedOrIndexed.Indexed:
+              first_parm = "indexed"
+
             identifier = IDLUnresolvedIdentifier(location, "__%s%s%s%s%s%s%s" %
-                ("named" if specialType == IDLMethod.NamedOrIndexed.Named else \
-                 "indexed" if specialType == IDLMethod.NamedOrIndexed.Indexed else "",
-                 "getter" if getter else "",
-                 "setter" if setter else "",
-                 "deleter" if deleter else "",
-                 "creator" if creator else "",
-                 "legacycaller" if legacycaller else "",
-                 "stringifier" if stringifier else ""), allowDoubleUnderscore=True)
+                (first_parm,
+                 ("", "getter")[getter], 
+                 ("", "setter")[setter],
+                 ("", "deleter")[deleter], 
+                 ("", "creator")[creator],
+                 ("", "legacycaller")[legacycaller], 
+                 ("", "stringifier")[stringifier]), 
+                allowDoubleUnderscore=True)
 
         method = IDLMethod(self.getLocation(p, 2), identifier, returnType, arguments,
                            static=static, getter=getter, setter=setter, creator=creator,
@@ -4391,7 +4423,10 @@ class Parser(Tokenizer):
         """
             ArgumentList : Argument Arguments
         """
-        p[0] = [p[1]] if p[1] else []
+        if p[1]:
+          p[0] = [p[1]]
+        else:
+          p[0] = []
         p[0].extend(p[2])
 
     def p_ArgumentListEmpty(self, p):
@@ -4404,7 +4439,10 @@ class Parser(Tokenizer):
         """
             Arguments : COMMA Argument Arguments
         """
-        p[0] = [p[2]] if p[2] else []
+        if p[2]:
+          p[0] = [p[2]]
+        else:
+          p[0] = []
         p[0].extend(p[3])
 
     def p_ArgumentsEmpty(self, p):
@@ -4539,7 +4577,10 @@ class Parser(Tokenizer):
         """
             ExtendedAttributes : COMMA ExtendedAttribute ExtendedAttributes
         """
-        p[0] = [p[2]] if p[2] else []
+        if p[2]:
+          p[0] = [p[2]]
+        else:
+          p[0] = []
         p[0].extend(p[3])
 
     def p_ExtendedAttributesEmpty(self, p):
@@ -5036,10 +5077,8 @@ class Parser(Tokenizer):
         # First, finish all the IDLImplementsStatements.  In particular, we
         # have to make sure we do those before we do the IDLInterfaces.
         # XXX khuey hates this bit and wants to nuke it from orbit.
-        implementsStatements = [ p for p in self._productions if
-                                 isinstance(p, IDLImplementsStatement)]
-        otherStatements = [ p for p in self._productions if
-                            not isinstance(p, IDLImplementsStatement)]
+        implementsStatements = [ p for p in self._productions if isinstance(p, IDLImplementsStatement)]
+        otherStatements = [ p for p in self._productions if not isinstance(p, IDLImplementsStatement)]
         for production in implementsStatements:
             production.finish(self.globalScope())
         for production in otherStatements:
diff -up mozilla-esr31/dom/imptests/importTestsuite.py.python3 mozilla-esr31/dom/imptests/importTestsuite.py
--- mozilla-esr31/dom/imptests/importTestsuite.py.python3	2014-08-25 15:17:03.000000000 +0200
+++ mozilla-esr31/dom/imptests/importTestsuite.py	2014-09-05 15:26:14.062680962 +0200
@@ -10,7 +10,11 @@ Note: removes both source and destinatio
       use with outstanding changes in either directory.
 """
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import shutil
@@ -50,7 +54,8 @@ def getData(confFile):
     iden = ""
     directories = []
     try:
-        with open(confFile, 'r') as fp:
+        fp = open(confFile, 'r')
+        if 1:
             first = True
             for line in fp:
                 if first:
@@ -58,6 +63,7 @@ def getData(confFile):
                     first = False
                 else:
                     directories.append(line.strip())
+        fp.close()
     finally:
         return vcs, url, iden, directories
 
@@ -129,16 +135,20 @@ def printBuildFiles(dest, directories):
         all_support |= set('%s/%s' % (d['path'], p) for p in d['supportfiles'])
 
         if d["reftests"]:
-            with open(path + "/reftest.list", "w") as fh:
+            fh = open(path + "/reftest.list", "w")
+            if 1:
                 result = writeBuildFiles.substReftestList("importTestsuite.py",
                     d["reftests"])
                 fh.write(result)
 
+            fh.close()
     manifest_path = dest + '/mochitest.ini'
-    with open(manifest_path, 'w') as fh:
+    fh = open(manifest_path, 'w')
+    if 1:
         result = writeBuildFiles.substManifest('importTestsuite.py',
             all_mochitests, all_support)
         fh.write(result)
+    fh.close()
     subprocess.check_call(["hg", "add", manifest_path])
 
 def hgadd(dest, directories):
@@ -176,7 +186,7 @@ def importRepo(confFile):
         hgadd(dest, directories)
         print("Removing %s again..." % hgdest)
         subprocess.check_call(["rm", "-rf", hgdest])
-    except subprocess.CalledProcessError as e:
+    except subprocess.CalledProcessError, e:
         print(e.returncode)
     finally:
         print("Done")
diff -up mozilla-esr31/dom/imptests/parseFailures.py.python3 mozilla-esr31/dom/imptests/parseFailures.py
--- mozilla-esr31/dom/imptests/parseFailures.py.python3	2014-08-25 15:17:03.000000000 +0200
+++ mozilla-esr31/dom/imptests/parseFailures.py	2014-09-05 15:26:14.062680962 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import collections
 import json
@@ -59,11 +63,13 @@ def writeFiles(files):
         pathmap.setdefault(dirp, []).append(leaf)
 
     for k, v in pathmap.items():
-        with open(k + '/mochitest.ini', 'w') as fh:
+        fh = open(k + '/mochitest.ini', 'w')
+        if 1:
             result = writeBuildFiles.substManifest('parseFailures.py', v, [])
             fh.write(result)
 
 
+        fh.close()
 def main(logPath):
     fp = open(logPath, 'rb')
     lines = extractLines(fp)
diff -up mozilla-esr31/dom/imptests/updateTestharness.py.python3 mozilla-esr31/dom/imptests/updateTestharness.py
--- mozilla-esr31/dom/imptests/updateTestharness.py.python3	2014-08-25 15:17:03.000000000 +0200
+++ mozilla-esr31/dom/imptests/updateTestharness.py	2014-09-05 15:26:14.062680962 +0200
@@ -3,7 +3,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import subprocess
 
@@ -18,7 +18,11 @@ subprocess.check_call(["git", "clone", r
 subprocess.check_call(["git", "submodule", "init"], cwd=dest)
 subprocess.check_call(["git", "submodule", "update"], cwd=dest)
 for f in files:
-    path = f["d"] if "d" in f else f["f"]
+    path = None
+    if "d" in f:
+      path = f["d"]
+    else:
+      path = f["f"]
     subprocess.check_call(["cp", "%s/%s" % (dest, path), f["f"]])
     subprocess.check_call(["hg", "add", f["f"]])
 subprocess.check_call(["rm", "-rf", dest])
diff -up mozilla-esr31/dom/imptests/writeBuildFiles.py.python3 mozilla-esr31/dom/imptests/writeBuildFiles.py
--- mozilla-esr31/dom/imptests/writeBuildFiles.py.python3	2014-08-25 15:17:03.000000000 +0200
+++ mozilla-esr31/dom/imptests/writeBuildFiles.py	2014-09-05 15:26:14.063680967 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import string
 
diff -up mozilla-esr31/gfx/gl/GLParseRegistryXML.py.python3 mozilla-esr31/gfx/gl/GLParseRegistryXML.py
--- mozilla-esr31/gfx/gl/GLParseRegistryXML.py.python3	2014-08-25 15:17:06.000000000 +0200
+++ mozilla-esr31/gfx/gl/GLParseRegistryXML.py	2014-09-05 15:26:14.063680967 +0200
@@ -181,7 +181,8 @@ class GLDatabase:
 
 
     def exportConsts(self, path):
-        with open(getScriptDir() + path,'w') as f:
+        f = open(getScriptDir() + path,'w')
+        if 1:
 
             headerFile = GLConstHeader(f)
             headerFile.formatFileBegin()
@@ -205,6 +206,7 @@ class GLDatabase:
             headerFile.formatFileEnd()
 
 
+        f.close()
 glDatabase = GLDatabase()
 
 success = glDatabase.loadXML('gl.xml')
diff -up mozilla-esr31/gfx/harfbuzz/src/gen-arabic-table.py.python3 mozilla-esr31/gfx/harfbuzz/src/gen-arabic-table.py
--- mozilla-esr31/gfx/harfbuzz/src/gen-arabic-table.py.python3	2014-08-25 15:17:06.000000000 +0200
+++ mozilla-esr31/gfx/harfbuzz/src/gen-arabic-table.py	2014-09-05 15:26:14.063680967 +0200
@@ -122,10 +122,14 @@ def print_shaping_table(f):
 	keys = shapes.keys ()
 	min_u, max_u = min (keys), max (keys)
 	for u in range (min_u, max_u + 1):
-		s = [shapes[u][shape] if u in shapes and shape in shapes[u] else 0
+		s = None
+if u in shapes and shape in shapes[u]:
+  s = [shapes[u][shape]
+else:
+  s = 0
 		     for shape in  ['initial', 'medial', 'final', 'isolated']]
 		value = ', '.join ("0x%04X" % c for c in s)
-		print "  {%s}, /* U+%04X %s */" % (value, u, names[u] if u in names else "")
+		print "  {%s}, /* U+%04X %s */" % (value, u, names[u]u in names = (""), )[]
 
 	print "};"
 	print
diff -up mozilla-esr31/gfx/layers/genTables.py.python3 mozilla-esr31/gfx/layers/genTables.py
--- mozilla-esr31/gfx/layers/genTables.py.python3	2014-08-25 15:17:06.000000000 +0200
+++ mozilla-esr31/gfx/layers/genTables.py	2014-09-05 15:26:14.063680967 +0200
@@ -3,10 +3,12 @@
 def table_generator(f):
   return ",\n".join([", ".join(["0x%2.2x" % h for h in [f(i) for i in range(r,r+16)]]) for r in range(0, 65536, 16)])
 
-with open("PremultiplyTables.h", "w") as f:
+f = open("PremultiplyTables.h", "w")
+if 1:
   f.write("const uint8_t PremultiplyTable[256*256] = {\n");
   f.write(table_generator(lambda i: ((i / 256) * (i % 256) + 254) / 255) + "\n")
   f.write("};\n");
   f.write("const uint8_t UnpremultiplyTable[256*256] = {\n");
-  f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
+  f.write(table_generator(lambda i: (i % 256) * 255 / ((255, i / 256)[(i / 256) > 0]) % 256) + "\n")
   f.write("};\n");
+f.close()
diff -up mozilla-esr31/gfx/thebes/gencjkcisvs.py.python3 mozilla-esr31/gfx/thebes/gencjkcisvs.py
--- mozilla-esr31/gfx/thebes/gencjkcisvs.py.python3	2014-08-25 15:17:07.000000000 +0200
+++ mozilla-esr31/gfx/thebes/gencjkcisvs.py	2014-09-05 15:26:14.063680967 +0200
@@ -6,7 +6,11 @@ import os.path
 import re
 import sys
 
-f = open(sys.argv[1] if len(sys.argv) > 1 else 'StandardizedVariants.txt')
+f = None
+if len(sys.argv) > 1:
+  f = open(sys.argv[1]
+else:
+  f = 'StandardizedVariants.txt')
 
 line = f.readline()
 m = re.compile('^# (StandardizedVariants(-\d+(\.\d+)*)?\.txt)').search(line)
@@ -37,7 +41,7 @@ for (k, mappings) in sorted(vsdict.items
     offsets.append(length)
     length += 4 + 5 * len(mappings)
 
-f = open(sys.argv[2] if len(sys.argv) > 2 else 'CJKCompatSVS.cpp', 'wb')
+f = open(('CJKCompatSVS.cpp', sys.argv[2])[len(sys.argv) > 2], 'wb')
 f.write("""// Generated by %s. Do not edit.
 
 #include <stdint.h>
diff -up mozilla-esr31/gfx/thebes/genTables.py.python3 mozilla-esr31/gfx/thebes/genTables.py
--- mozilla-esr31/gfx/thebes/genTables.py.python3	2014-08-25 15:17:07.000000000 +0200
+++ mozilla-esr31/gfx/thebes/genTables.py	2014-09-05 15:26:14.063680967 +0200
@@ -3,10 +3,14 @@
 def table_generator(f):
     return ",\n".join([", ".join(["0x%2.2x" % h for h in [f(i) for i in range(r,r+16)]]) for r in range(0, 65536, 16)])
 
-with open("DeprecatedPremultiplyTables.h", "w") as f:
+f = open("DeprecatedPremultiplyTables.h", "w")
+if 1:
   f.write("const uint8_t gfxUtils::sPremultiplyTable[256*256] = {\n");
   f.write(table_generator(lambda i: ((i / 256) * (i % 256) + 254) / 255) + "\n")
   f.write("};\n");
   f.write("const uint8_t gfxUtils::sUnpremultiplyTable[256*256] = {\n");
-  f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
+  #f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
+  #f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256, 255)[(i / 256) > 0]) % 256) + "\n")
+  f.write(table_generator(lambda i: (i % 256) * 255 / ((255, i / 256)[(i / 256) > 0]) % 256) + "\n")
   f.write("};\n");
+f.close()
diff -up mozilla-esr31/ipc/chromium/src/third_party/libevent/event_rpcgen.py.python3 mozilla-esr31/ipc/chromium/src/third_party/libevent/event_rpcgen.py
--- mozilla-esr31/ipc/chromium/src/third_party/libevent/event_rpcgen.py.python3	2014-08-25 15:17:09.000000000 +0200
+++ mozilla-esr31/ipc/chromium/src/third_party/libevent/event_rpcgen.py	2014-09-05 15:26:14.063680967 +0200
@@ -1628,8 +1628,7 @@ class Usage(RpcGenError):
 
 class CommandLine:
     def __init__(self, argv):
-        """Initialize a command-line to launch event_rpcgen, as if
-           from a command-line with CommandLine(sys.argv).  If you're
+        """Initialize a command-line to launch event_rpcgen, as if from a command-line with CommandLine(sys.argv).  If you're
            calling this directly, remember to provide a dummy value
            for sys.argv[0]
         """
diff -up mozilla-esr31/ipc/ipdl/ipdl/__init__.py.python3 mozilla-esr31/ipc/ipdl/ipdl/__init__.py
--- mozilla-esr31/ipc/ipdl/ipdl/__init__.py.python3	2014-08-25 15:17:09.000000000 +0200
+++ mozilla-esr31/ipc/ipdl/ipdl/__init__.py	2014-09-05 15:26:14.064680972 +0200
@@ -30,8 +30,7 @@ def parse(specstring, filename='/stdin',
 
 
 def typecheck(ast, errout=sys.stderr):
-    '''Return True iff |ast| is well typed.  Print errors to |errout| if
-    it is not.'''
+    '''Return True iff |ast| is well typed.  Print errors to |errout| if it is not.'''
     return TypeCheck().check(ast, errout)
 
 
diff -up mozilla-esr31/ipc/ipdl/ipdl/lower.py.python3 mozilla-esr31/ipc/ipdl/ipdl/lower.py
--- mozilla-esr31/ipc/ipdl/ipdl/lower.py.python3	2014-08-25 15:17:09.000000000 +0200
+++ mozilla-esr31/ipc/ipdl/ipdl/lower.py	2014-09-05 15:26:14.064680972 +0200
@@ -3876,7 +3876,7 @@ class _GenerateProtocolActorCode(ipdl.as
 
             registerstmt = StmtExpr(ExprCall(p.registerIDMethod(),
                                     args=[actorvar, _actorId(actorvar)]))
-            # Implement if (actor id > 0) then Register() else RegisterID()
+            # Implement(actor id > 0) then Register() = (RegisterID(), )[]
             if manageeipdltype in inoutCtorTypes:
                 registerif = StmtIf(ExprBinary(_actorId(actorvar),
                                                '>',
@@ -4684,7 +4684,7 @@ class _GenerateProtocolActorCode(ipdl.as
                 ct = c.bareType()
                 readcase.addstmts([
                     StmtDecl(Decl(ct, tmpvar.name),
-                      init=c.defaultValue() if ct.ptr else None),
+                      init=(None, c.defaultValue())[ct.ptr]),
                     StmtExpr(ExprAssn(ExprDeref(var), tmpvar)),
                     StmtReturn(self.read(
                         c.ipdltype,
@@ -5363,7 +5363,7 @@ class _GenerateProtocolActorCode(ipdl.as
             ExprSelect(msgptr, '->', 'Log'),
             args=[ ExprLiteral.String('['+ actorname +'] '+ pfx),
                    self.protocol.callOtherProcess(actor),
-                   ExprLiteral.TRUE if receiving else ExprLiteral.FALSE ])) ])
+                   (ExprLiteral.FALSE, ExprLiteral.TRUE)[receiving] ])) ])
 
     def profilerLabel(self, tag, msgname):
         return StmtExpr(ExprCall(ExprVar('PROFILER_LABEL'),
@@ -5393,7 +5393,11 @@ class _GenerateProtocolActorCode(ipdl.as
             action = ExprVar('Trigger::Recv')
         else: assert 0 and 'unknown combo %s/%s'% (self.side, direction)
 
-        msgid = md.pqMsgId() if not reply else md.pqReplyId()
+        msgid = None
+        if not reply:
+          msgid = md.pqMsgId()
+        else:
+          msgid = md.pqReplyId()
         ifbad = StmtIf(ExprNot(
             ExprCall(
                 ExprVar(self.protocol.name +'::Transition'),
diff -up mozilla-esr31/js/src/builtin/embedjs.py.python3 mozilla-esr31/js/src/builtin/embedjs.py
--- mozilla-esr31/js/src/builtin/embedjs.py.python3	2014-08-25 15:17:09.000000000 +0200
+++ mozilla-esr31/js/src/builtin/embedjs.py	2014-09-05 15:26:14.064680972 +0200
@@ -36,7 +36,7 @@
 #
 # It uses the C preprocessor to process its inputs.
 
-from __future__ import with_statement
+
 import re, sys, os, fileinput, subprocess
 import shlex
 from optparse import OptionParser
@@ -81,8 +81,10 @@ def embed(cpp, msgs, sources, c_out, js_
   # Clang seems to complain and not output anything if the extension of the
   # input is not something it recognizes, so just fake a .h here.
   tmp = 'selfhosted.js.h'
-  with open(tmp, 'wb') as output:
+  output = open(tmp, 'wb')
+  if 1:
     output.write('\n'.join([msgs] + ['#include "%(s)s"' % { 's': source } for source in sources]))
+  output.close()
   cmdline = cpp + ['-D%(k)s=%(v)s' % { 'k': k, 'v': env[k] } for k in env] + [tmp]
   p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
   processed = ''
@@ -90,9 +92,12 @@ def embed(cpp, msgs, sources, c_out, js_
     if not line.startswith('#'):
       processed += line
   os.remove(tmp)
-  with open(js_out, 'w') as output:
+  output = open(js_out, 'w')
+  if 1:
     output.write(processed)
-  with open(c_out, 'w') as output:
+  output.close()
+  output = open(c_out, 'w')
+  if 1:
     if 'USE_ZLIB' in env:
       import zlib
       compressed = zlib.compress(processed)
@@ -114,12 +119,15 @@ def embed(cpp, msgs, sources, c_out, js_
           'raw_total_length': len(processed)
       })
 
+  output.close()
 def process_msgs(cpp, msgs):
   # Clang seems to complain and not output anything if the extension of the
   # input is not something it recognizes, so just fake a .h here.
   tmp = 'selfhosted.msg.h'
-  with open(tmp, 'wb') as output:
+  output = open(tmp, 'wb')
+  if 1:
     output.write("""\
+  output.close()
 #define hash #
 #define id(x) x
 #define hashify(x) id(hash)x
diff -up mozilla-esr31/js/src/configure.python3 mozilla-esr31/js/src/configure
--- mozilla-esr31/js/src/configure.python3	2014-08-25 15:18:03.000000000 +0200
+++ mozilla-esr31/js/src/configure	2014-09-05 15:26:14.066680982 +0200
@@ -16270,7 +16270,8 @@ rm confdefs.pytmp confdefs.h
 cat >> $CONFIG_STATUS <<\EOF
 ] ]
 
-substs = [(name[1:-1], value[1:-1] if isinstance(value, types.StringTypes) else value) for name, value in [
+substs = []
+mylist = [
 EOF
 
 sed 's/$/,/' >> $CONFIG_STATUS <<EOF
@@ -16578,7 +16579,12 @@ for ac_subst_arg in $_subconfigure_ac_su
 done
 
 cat >> $CONFIG_STATUS <<\EOF
-] ]
+]
+for name, value in mylist:
+  if isinstance(value, types.StringTypes):
+    substs.append( (name[1:-1], value[1:-1]) )
+  else:
+    substs.append( (name[1:-1], value) )
 
 non_global_defines = [
 EOF
diff -up mozilla-esr31/js/src/devtools/rootAnalysis/analyze.py.python3 mozilla-esr31/js/src/devtools/rootAnalysis/analyze.py
--- mozilla-esr31/js/src/devtools/rootAnalysis/analyze.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/devtools/rootAnalysis/analyze.py	2014-09-05 15:26:14.066680982 +0200
@@ -89,11 +89,13 @@ def generate_hazards(config, outfilename
     if final_status:
         raise subprocess.CalledProcessError(final_status, 'analyzeRoots.js')
 
-    with open(outfilename, 'w') as output:
+    output = open(outfilename, 'w')
+    if 1:
         command = ['cat'] + [ 'rootingHazards.%s' % (i+1,) for i in range(config['jobs']) ]
         print_command(command, outfile=outfilename)
         subprocess.call(command, stdout=output)
 
+    output.close()
 JOBS = { 'dbs':
              (('%(ANALYSIS_SCRIPTDIR)s/run_complete',
                '--foreground',
@@ -171,8 +173,10 @@ def run_job(name, config):
         if stdout_filename is None:
             subprocess.check_call(command, env=env(config))
         else:
-            with open(stdout_filename, 'w') as output:
+            output = open(stdout_filename, 'w')
+            if 1:
                 subprocess.check_call(command, stdout=output, env=env(config))
+            output.close()
         for (temp, final) in temp_map.items():
             try:
                 os.rename(temp, final)
diff -up mozilla-esr31/js/src/devtools/rootAnalysis/explain.py.python3 mozilla-esr31/js/src/devtools/rootAnalysis/explain.py
--- mozilla-esr31/js/src/devtools/rootAnalysis/explain.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/devtools/rootAnalysis/explain.py	2014-09-05 15:26:14.066680982 +0200
@@ -65,7 +65,8 @@ try:
                 else:
                     hazardousGCFunctions[current_gcFunction][-1] += line
 
-        with open(args.gcFunctions) as gcFunctions:
+        gcFunctions = open(args.gcFunctions)
+        if 1:
             gcExplanations = {}  # gcFunction => stack showing why it can GC
 
             current_func = None
@@ -91,7 +92,8 @@ try:
                 else:
                     print >>hazards, gcHazards[index]
 
-except IOError as e:
+        gcFunctions.close()
+except IOError, e:
     print 'Failed: %s' % str(e)
 
 print("Wrote %s" % args.hazards)
diff -up mozilla-esr31/js/src/gdb/lib-for-tests/catcher.py.python3 mozilla-esr31/js/src/gdb/lib-for-tests/catcher.py
--- mozilla-esr31/js/src/gdb/lib-for-tests/catcher.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/lib-for-tests/catcher.py	2014-09-05 15:26:14.066680982 +0200
@@ -16,7 +16,7 @@ try:
     # testlibdir is set on the GDB command line, via:
     # --eval-command python testlibdir=...
     execfile(os.path.join(testlibdir, 'prolog.py'))
-except Exception as err:
+except Exception, err:
     sys.stderr.write('Error running GDB prologue:\n')
     traceback.print_exc()
     sys.exit(1)
diff -up mozilla-esr31/js/src/gdb/lib-for-tests/prolog.py.python3 mozilla-esr31/js/src/gdb/lib-for-tests/prolog.py
--- mozilla-esr31/js/src/gdb/lib-for-tests/prolog.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/lib-for-tests/prolog.py	2014-09-05 15:26:14.067680987 +0200
@@ -65,7 +65,7 @@ try:
     # testscript is set on the GDB command line, via:
     # --eval-command python testscript=...
     execfile(testscript)
-except AssertionError as err:
+except AssertionError, err:
     sys.stderr.write('\nAssertion traceback:\n')
     (t, v, tb) = sys.exc_info()
     traceback.print_tb(tb)
diff -up mozilla-esr31/js/src/gdb/mozilla/JSObject.py.python3 mozilla-esr31/js/src/gdb/mozilla/JSObject.py
--- mozilla-esr31/js/src/gdb/mozilla/JSObject.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/mozilla/JSObject.py	2014-09-05 15:26:14.067680987 +0200
@@ -46,10 +46,13 @@ class JSObjectPtrOrRef(prettyprinters.Po
                 function = function.address
             function = function.cast(self.otc.func_ptr_type)
             atom = deref(function['atom_'])
-            name = str(atom) if atom else '<unnamed>'
+            name = None
+            if atom:
+              name = str(atom)
+            else:
+              name = '<unnamed>'
         return '[object %s%s]%s' % (class_name,
-                                    ' ' + name if name else '',
-                                    ' delegate' if is_delegate else '')
+                                    ('', ' ' + name)[name], ('', ' delegate')[is_delegate])
 
 @ref_pretty_printer('JSObject')
 def JSObjectRef(value, cache): return JSObjectPtrOrRef(value, cache)
diff -up mozilla-esr31/js/src/gdb/mozilla/jsval.py.python3 mozilla-esr31/js/src/gdb/mozilla/jsval.py
--- mozilla-esr31/js/src/gdb/mozilla/jsval.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/mozilla/jsval.py	2014-09-05 15:26:14.067680987 +0200
@@ -171,7 +171,11 @@ class jsvalTypeCache(object):
         for (k,v) in d.items(): self.magic_names[v] = k
 
         # Choose an unboxing scheme for this architecture.
-        self.boxer = Punbox if cache.void_ptr_t.sizeof == 8 else Nunbox
+        self.boxer = None
+        if cache.void_ptr_t.sizeof == 8:
+          self.boxer = Punbox
+        else:
+          self.boxer = Nunbox
 
 @pretty_printer('jsval_layout')
 class jsval_layout(object):
@@ -194,7 +198,7 @@ class jsval_layout(object):
         elif tag == self.jtc.UNDEFINED:
             return 'JSVAL_VOID'
         elif tag == self.jtc.BOOLEAN:
-            return 'JSVAL_TRUE' if self.box.as_uint32() else 'JSVAL_FALSE'
+            return ('JSVAL_FALSE', 'JSVAL_TRUE')[self.box.as_uint32()]
         elif tag == self.jtc.MAGIC:
             value = self.box.as_uint32()
             if 0 <= value and value < len(self.jtc.magic_names):
diff -up mozilla-esr31/js/src/gdb/mozilla/prettyprinters.py.python3 mozilla-esr31/js/src/gdb/mozilla/prettyprinters.py
--- mozilla-esr31/js/src/gdb/mozilla/prettyprinters.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/mozilla/prettyprinters.py	2014-09-05 15:26:14.067680987 +0200
@@ -335,7 +335,7 @@ class Pointer(object):
             assert not "mozilla.prettyprinters.Pointer applied to bad value type"
         try:
             summary = self.summary()
-        except gdb.MemoryError as r:
+        except gdb.MemoryError, r:
             summary = str(r)
         v = '(%s) %s %s' % (self.value.type, address, summary)
         return v
diff -up mozilla-esr31/js/src/gdb/run-tests.py.python3 mozilla-esr31/js/src/gdb/run-tests.py
--- mozilla-esr31/js/src/gdb/run-tests.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/run-tests.py	2014-09-05 15:26:14.067680987 +0200
@@ -110,20 +110,24 @@ class Summary(object):
 
             if OPTIONS.worklist:
                 try:
-                    with open(OPTIONS.worklist) as out:
+                    out = open(OPTIONS.worklist)
+                    if 1:
                         for test in self.failures:
                             out.write(test.name + '\n')
-                except IOError as err:
+                    out.__exit__(0, 0, 0)
+                except IOError, err:
                     sys.stderr.write("Error writing worklist file '%s': %s"
                                      % (OPTIONS.worklist, err))
                     sys.exit(1)
 
             if OPTIONS.write_failures:
                 try:
-                    with open(OPTIONS.write_failures) as out:
+                    out = open(OPTIONS.write_failures).__enter__()
+                    if 1:
                         for test in self.failures:
                             test.show(out)
-                except IOError as err:
+                    out.close()
+                except IOError, err:
                     sys.stderr.write("Error writing worklist file '%s': %s"
                                      % (OPTIONS.write_failures, err))
                     sys.exit(1)
@@ -288,9 +292,11 @@ def main(argv):
             test_set.update(find_tests(OPTIONS.testdir, arg))
     if OPTIONS.worklist:
         try:
-            with open(OPTIONS.worklist) as f:
+            f = open(OPTIONS.worklist)
+            if 1:
                 for line in f:
                     test_set.update(os.path.join(test_dir, line.strip('\n')))
+            f.__exit__(0, 0, 0)
         except IOError:
             # With worklist, a missing file means to start the process with
             # the complete list of tests.
@@ -299,10 +305,12 @@ def main(argv):
             test_set = set(find_tests(OPTIONS.testdir))
     if OPTIONS.read_tests:
         try:
-            with open(OPTIONS.read_tests) as f:
+            f = open(OPTIONS.read_tests).__enter__()
+            if 1:
                 for line in f:
                     test_set.update(os.path.join(test_dir, line.strip('\n')))
-        except IOError as err:
+            f.close()
+        except IOError, err:
             sys.stderr.write("Error trying to read test file '%s': %s\n"
                              % (OPTIONS.read_tests, err))
             sys.exit(1)
@@ -329,7 +337,7 @@ def main(argv):
     # directory tree.
     try:
         build_test_exec(OPTIONS.builddir)
-    except subprocess.CalledProcessError as err:
+    except subprocess.CalledProcessError, err:
         sys.stderr.write("Error building test executable: %s\n" % (err,))
         sys.exit(1)
 
@@ -338,7 +346,7 @@ def main(argv):
         summary.start()
         run_tests(test_list, summary)
         summary.finish()
-    except OSError as err:
+    except OSError, err:
         sys.stderr.write("Error running tests: %s\n" % (err,))
         sys.exit(1)
 
diff -up mozilla-esr31/js/src/gdb/taskpool.py.python3 mozilla-esr31/js/src/gdb/taskpool.py
--- mozilla-esr31/js/src/gdb/taskpool.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/gdb/taskpool.py	2014-09-05 15:26:14.067680987 +0200
@@ -75,7 +75,8 @@ class TaskPool(object):
     def run_all(self):
         # The currently running tasks: a set of Task instances.
         running = set()
-        with open(os.devnull, 'r') as devnull:
+        devnull = open(os.devnull, 'r')
+        if 1:
             while True:
                 while len(running) < self.job_limit and self.next_pending:
                     t = self.next_pending
@@ -158,6 +159,7 @@ class TaskPool(object):
                 # Remove the finished tasks from the running set. (Do this here
                 # to avoid mutating the set while iterating over it.)
                 running -= finished
+        devnull.close()
         return None
 
 def get_cpu_count():
diff -up mozilla-esr31/js/src/jit-test/jit_test.py.python3 mozilla-esr31/js/src/jit-test/jit_test.py
--- mozilla-esr31/js/src/jit-test/jit_test.py.python3	2014-08-25 15:17:10.000000000 +0200
+++ mozilla-esr31/js/src/jit-test/jit_test.py	2014-09-05 15:26:14.067680987 +0200
@@ -109,8 +109,7 @@ def main(argv):
     test_args = args[1:]
 
     if jittests.stdio_might_be_broken():
-        # Prefer erring on the side of caution and not using stdio if
-        # it might be broken on this platform.  The file-redirect
+        # Prefer erring on the side of caution and not using stdio if # it might be broken on this platform.  The file-redirect
         # fallback should work on any platform, so at worst by
         # guessing wrong we might have slowed down the tests a bit.
         #
diff -up mozilla-esr31/js/src/tests/jstests.py.python3 mozilla-esr31/js/src/tests/jstests.py
--- mozilla-esr31/js/src/tests/jstests.py.python3	2014-08-25 15:17:12.000000000 +0200
+++ mozilla-esr31/js/src/tests/jstests.py	2014-09-05 15:26:14.067680987 +0200
@@ -151,7 +151,11 @@ def parse_args():
         op.error("--valgrind and --debug are mutually exclusive.")
 
     # Fill the debugger field, as needed.
-    prefix = options.debugger.split() if options.debug else []
+    prefix = None
+    if options.debug:
+      prefix = options.debugger.split()
+    else:
+      prefix = []
     if options.valgrind:
         prefix = ['valgrind'] + options.valgrind_args.split()
         if os.uname()[0] == 'Darwin':
diff -up mozilla-esr31/js/src/tests/lib/manifest.py.python3 mozilla-esr31/js/src/tests/lib/manifest.py
--- mozilla-esr31/js/src/tests/lib/manifest.py.python3	2014-08-25 15:17:12.000000000 +0200
+++ mozilla-esr31/js/src/tests/lib/manifest.py	2014-09-05 15:26:14.068680992 +0200
@@ -286,7 +286,8 @@ def _parse_external_manifest(filename, r
     """
     entries = []
 
-    with open(filename, 'r') as fp:
+    fp = open(filename, 'r')
+    if 1:
         manifest_re = re.compile(r'^\s*(.*)\s+(include|script)\s+(\S+)$')
         for line in fp:
             line, _, comment = line.partition('#')
@@ -309,6 +310,7 @@ def _parse_external_manifest(filename, r
 
             entries.append({'path': path, 'terms': matches.group(1), 'comment': comment.strip()})
 
+    fp.close()
     # if one directory name is a prefix of another, we want the shorter one first
     entries.sort(key=lambda x: x["path"])
     return entries
diff -up mozilla-esr31/js/src/tests/lib/progressbar.py.python3 mozilla-esr31/js/src/tests/lib/progressbar.py
--- mozilla-esr31/js/src/tests/lib/progressbar.py.python3	2014-08-25 15:17:12.000000000 +0200
+++ mozilla-esr31/js/src/tests/lib/progressbar.py	2014-09-05 15:26:14.068680992 +0200
@@ -79,7 +79,11 @@ class ProgressBar(object):
         self.update(*self.prior)
 
     def finish(self, complete=True):
-        final_count = self.limit if complete else self.prior[0]
+        final_count = None
+        if complete:
+          final_count = self.limit
+        else:
+          final_count = self.prior[0]
         self.update(final_count, self.prior[1])
         sys.stdout.write('\n')
 
@@ -96,8 +100,7 @@ class ProgressBar(object):
     @staticmethod
     def conservative_isatty():
         """
-        Prefer erring on the side of caution and not using terminal commands if
-        the current output stream may be a file.  We explicitly check for the
+        Prefer erring on the side of caution and not using terminal commands if the current output stream may be a file.  We explicitly check for the
         Android platform because terminal commands work poorly over ADB's
         redirection.
         """
diff -up mozilla-esr31/js/src/tests/lib/results.py.python3 mozilla-esr31/js/src/tests/lib/results.py
--- mozilla-esr31/js/src/tests/lib/results.py.python3	2014-08-25 15:17:12.000000000 +0200
+++ mozilla-esr31/js/src/tests/lib/results.py	2014-09-05 15:26:14.068680992 +0200
@@ -167,7 +167,10 @@ class ResultsSink:
 
             if dev_label:
                 def singular(label):
-                    return "FIXED" if label == "FIXES" else label[:-1]
+                    if label == "FIXES":
+                      return "FIXED"
+                    else:
+                      return label[:-1]
                 self.pb.message("%s - %s" % (singular(dev_label), output.test.path))
 
         self.pb.update(self.n, self.counts)
@@ -216,7 +219,7 @@ class ResultsSink:
                           print >> failure_file, path
               failure_file.close()
 
-        suffix = '' if completed else ' (partial run -- interrupted by user)'
+        suffix = (' (partial run -- interrupted by user)', '')[completed]
         if self.all_passed():
             print 'PASS' + suffix
         else:
diff -up mozilla-esr31/js/xpconnect/src/event_impl_gen.py.python3 mozilla-esr31/js/xpconnect/src/event_impl_gen.py
--- mozilla-esr31/js/xpconnect/src/event_impl_gen.py.python3	2014-08-25 15:17:14.000000000 +0200
+++ mozilla-esr31/js/xpconnect/src/event_impl_gen.py	2014-09-05 15:26:14.068680992 +0200
@@ -499,13 +499,13 @@ def toWebIDLType(attribute, inType=False
     if attribute.type == "nsIVariant":
         return "any";
     if attribute.type == "nsISupports":
-        return "%s%s" % (attribute.type, "" if onlyInterface else "?")
+        return "%s%s" % (attribute.type, ("?", "")[onlyInterface])
     if attribute.type.count("nsIDOM"):
-        return "%s%s" % (attribute.type[6:], "" if onlyInterface else "?")
+        return "%s%s" % (attribute.type[6:], ("?", "")[onlyInterface])
     if attribute.type.count("nsI"):
-        return "%s%s" % (attribute.type[3:], "" if onlyInterface else "?")
+        return "%s%s" % (attribute.type[3:], ("?", "")[onlyInterface])
     if attribute.realtype.nativeType('in').endswith('*') or attribute.realtype.nativeType('in').count("nsAString"):
-        return "%s%s" % (attribute.type, "" if onlyInterface else "?")
+        return "%s%s" % (attribute.type, ("?", "")[onlyInterface])
     return attribute.type
 
 def write_webidl(eventname, iface, fd, conf, idl):
diff -up mozilla-esr31/js/xpconnect/src/qsgen.py.python3 mozilla-esr31/js/xpconnect/src/qsgen.py
--- mozilla-esr31/js/xpconnect/src/qsgen.py.python3	2014-08-25 15:17:14.000000000 +0200
+++ mozilla-esr31/js/xpconnect/src/qsgen.py	2014-09-05 15:26:14.068680992 +0200
@@ -22,8 +22,8 @@
 # case, everything that involves interpreting xptcall data (for example, the
 # big methodInfo loops in XPCWrappedNative::CallMethod and the switch statement
 # in XPCConert::JSData2Native) might as well happen at build time, since all
-# the type information for any given member is already known.  That's what this
-# script does.  It gets the information from IDL instead of XPT files.  Apart
+# the type i % ion for any given member is already known.  That's what this
+# script does.  It gets the i % ion from IDL instead of XPT files.  Apart
 # from that, the code in this script is very similar to what you'll find in
 # XPConnect itself.  The advantage is that it runs once, at build time, not in
 # tight loops at run time.
@@ -233,7 +233,7 @@ def readConfigFile(filename, includePath
     # Read the config file.
     conf = Configuration(filename, includePath)
 
-    # Now read IDL files to connect the information in the config file to
+    # Now read IDL files to connect the i % ion in the config file to
     # actual XPCOM interfaces, methods, and attributes.
     interfaces = []
     interfacesByName = {}
@@ -512,12 +512,12 @@ def writeArgumentUnboxing(f, i, name, ty
             # passed in at all. In that case, point the MutableHandleValue at a
             # dummy variable, and pass in a boolean saying that the argument
             # wasn't passed (previously, this used a NULL ptr sentinel value.)
-            f.write("    JS::RootedValue {name}_dummy(cx);\n".format(name=name))
-            f.write("    JS::MutableHandleValue {name}_mhv({i} < argc ? args[{i}] : &{name}_dummy);\n".format(name=name, i=i))
-            f.write("    (void) {name}_mhv;\n".format(name=name, i=i))
+            f.write("    JS::RootedValue %s_dummy(cx);\n" % name)
+            f.write("    JS::MutableHandleValue %s_mhv(%d < argc ? args[%d] : &%s_dummy);\n" % (name, i, i, name))
+            f.write("    (void) %s_mhv;\n" % (name))
 
-            argPtr = "{name}_mhv".format(name=name)
-            notPassed = "argc < {i}".format(i=i)
+            argPtr = "%s_mhv" % name
+            notPassed = "argc < %d" % i
     else:
         argVal = "args[%d]" % i
         argPtr = "args[%d]" % i
diff -up mozilla-esr31/layout/tools/reftest/b2g_desktop.py.python3 mozilla-esr31/layout/tools/reftest/b2g_desktop.py
--- mozilla-esr31/layout/tools/reftest/b2g_desktop.py.python3	2014-08-25 15:17:19.000000000 +0200
+++ mozilla-esr31/layout/tools/reftest/b2g_desktop.py	2014-09-05 15:26:14.069680997 +0200
@@ -1,7 +1,11 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import json
 import os
diff -up mozilla-esr31/layout/tools/reftest/mach_commands.py.python3 mozilla-esr31/layout/tools/reftest/mach_commands.py
--- mozilla-esr31/layout/tools/reftest/mach_commands.py.python3	2014-08-25 15:17:19.000000000 +0200
+++ mozilla-esr31/layout/tools/reftest/mach_commands.py	2014-09-05 15:26:14.069680997 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import mozpack.path
 import os
@@ -142,15 +142,19 @@ class ReftestRunner(MozbuildObject):
 
         # The imp module can spew warnings if the modules below have
         # already been imported, ignore them.
-        with warnings.catch_warnings():
+        warnings.catch_warnings().__enter__()
+        if 1:
             warnings.simplefilter('ignore')
 
             import imp
             path = os.path.join(self.reftest_dir, 'runreftestb2g.py')
-            with open(path, 'r') as fh:
+            fh = open(path, 'r')
+            if 1:
                 imp.load_module('reftest', fh, path, ('.py', 'r', imp.PY_SOURCE))
+            fh.close()
             import reftest
 
+        warnings.catch_warnings().__exit__(0, 0, 0)
         # Set up the reftest options.
         parser = reftest.B2GOptions()
         options, args = parser.parse_args([])
diff -up mozilla-esr31/layout/tools/reftest/runreftestb2g.py.python3 mozilla-esr31/layout/tools/reftest/runreftestb2g.py
--- mozilla-esr31/layout/tools/reftest/runreftestb2g.py.python3	2014-08-25 15:17:19.000000000 +0200
+++ mozilla-esr31/layout/tools/reftest/runreftestb2g.py	2014-09-05 15:26:14.069680997 +0200
@@ -400,9 +400,11 @@ class B2GRemoteReftest(RefTest):
                 config.set(section, 'Path', profilePath)
 
         newProfilesIni = tempfile.mktemp()
-        with open(newProfilesIni, 'wb') as configfile:
+        configfile = open(newProfilesIni, 'wb')
+        if 1:
             config.write(configfile)
 
+        configfile.close()
         self._devicemanager.pushFile(newProfilesIni, self.remoteProfilesIniPath)
         try:
             os.remove(newProfilesIni)
diff -up mozilla-esr31/layout/tools/reftest/runreftest.py.python3 mozilla-esr31/layout/tools/reftest/runreftest.py
--- mozilla-esr31/layout/tools/reftest/runreftest.py.python3	2014-08-25 15:17:19.000000000 +0200
+++ mozilla-esr31/layout/tools/reftest/runreftest.py	2014-09-05 15:26:14.069680997 +0200
@@ -57,14 +57,18 @@ class ReftestThread(threading.Thread):
       self.summaryMatches[text] = None
 
   def run(self):
-    with printLock:
+    printLock.__enter__()
+    if 1:
       print "Starting thread with", self.cmdlineArgs
       sys.stdout.flush()
+    printLock.__exit__(0, 0, 0)
     process = subprocess.Popen(self.cmdlineArgs, stdout=subprocess.PIPE)
     for chunk in self.chunkForMergedOutput(process.stdout):
-      with printLock:
+      printLock.__enter__()
+      if 1:
         print chunk,
         sys.stdout.flush()
+      printLock.__exit__(0, 0, 0)
     self.retcode = process.wait()
 
   def chunkForMergedOutput(self, logsource):
@@ -301,9 +305,17 @@ class RefTest(object):
       for (summaryObj, (text, categories)) in zip(summaryObjects, summaryLines):
         threadMatches = t.summaryMatches[text]
         for (attribute, description) in categories:
-          amount = int(threadMatches.group(attribute) if threadMatches else 0)
+          amount = None
+          if threadMatches:
+            amount = int(threadMatches.group(attribute)
+          else:
+            amount = 0)
           summaryObj[attribute] += amount
-        amount = int(threadMatches.group('total') if threadMatches else 0)
+        amount = None
+        if threadMatches:
+          amount = int(threadMatches.group('total')
+        else:
+          amount = 0)
         summaryObj['total'] += amount
 
     print 'REFTEST INFO | Result summary:'
diff -up mozilla-esr31/media/libopus/gen-sources.py.python3 mozilla-esr31/media/libopus/gen-sources.py
--- mozilla-esr31/media/libopus/gen-sources.py.python3	2014-08-25 15:17:19.000000000 +0200
+++ mozilla-esr31/media/libopus/gen-sources.py	2014-09-05 15:26:14.069680997 +0200
@@ -27,14 +27,16 @@ def generate_sources_mozbuild(path):
     ]
 
     var_definition = re.compile('([A-Z_]*) = (.*)')
-    with open('sources.mozbuild', 'w') as output:
+    output = open('sources.mozbuild', 'w')
+    if 1:
 
         output.write('# THIS FILE WAS AUTOMATICALLY GENERATED BY %s. DO NOT EDIT.\n' % sys.argv[0])
         for makefile in makefiles:
             values = []
             definition_started = False
 
-            with open('%s/%s' % (path, makefile), 'r') as mk:
+            mk = open('%s/%s' % (path, makefile), 'r')
+            if 1:
                 for line in mk:
                     line = line.rstrip()
                     result = var_definition.match(line)
@@ -60,8 +62,10 @@ def generate_sources_mozbuild(path):
                         add_value(values, result.group(2))
                     else:
                         add_value(values, line)
+            mk.close()
             write_values(output, values)
 
+    output.close()
 if __name__ == '__main__':
     if len(sys.argv) != 2:
         print "Usage: %s /path/to/opus" % (sys.argv[0])
diff -up mozilla-esr31/media/libvpx/update.py.python3 mozilla-esr31/media/libvpx/update.py
--- mozilla-esr31/media/libvpx/update.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/libvpx/update.py	2014-09-05 15:26:14.069680997 +0200
@@ -330,7 +330,8 @@ def get_sources(prefix):
     disabled = {}
 
     for mk in mk_files:
-        with open(os.path.join(prefix, mk)) as f:
+        f = open(os.path.join(prefix, mk))
+        if 1:
             base = os.path.dirname(mk)
             for l in f:
                 if '+=' in l:
@@ -343,6 +344,7 @@ def get_sources(prefix):
                             source[key] = []
                         source[key].append(value)
 
+        f.__exit__(0, 0, 0)
     for key in source:
         for f in source[key]:
             if key.endswith('EXPORTS') and f.endswith('.h'):
@@ -376,9 +378,11 @@ def update_sources_mozbuild(files, sourc
     sources_mozbuild_new = "files = {\n %s\n}\n" % f.getvalue().strip()[1:-1]
     if sources_mozbuild != sources_mozbuild_new:
         print 'updating sources.mozbuild'
-        with open('sources.mozbuild', 'w') as f:
+        f = open('sources.mozbuild', 'w')
+        if 1:
             f.write(sources_mozbuild_new)
 
+        f.close()
 def get_current_files():
     current_files = []
     for root, folders, files in os.walk('.'):
@@ -396,8 +400,10 @@ def is_new(a, b):
         or open(a).read() != open(b).read()
 
 def get_sources_mozbuild():
-    with open('sources.mozbuild') as f:
+    f = open('sources.mozbuild')
+    if 1:
         sources_mozbuild = f.read()
+    f.__exit__(0, 0, 0)
     exec(sources_mozbuild)
     return sources_mozbuild, files
 
@@ -455,9 +461,11 @@ def apply_patches():
     os.system("patch -p3 < mingw.patch")
 
 def update_readme(commit):
-    with open('README_MOZILLA') as f:
+    f = open('README_MOZILLA').__enter__()
+    if 1:
         readme = f.read()
 
+    f.close()
     if 'The git commit ID used was' in readme:
         new_readme = re.sub('The git commit ID used was [a-f0-9]+',
             'The git commit ID used was %s' % commit, readme)
@@ -465,9 +473,11 @@ def update_readme(commit):
         new_readme = "%s\n\nThe git commit ID used was %s\n" % (readme, commit)
 
     if readme != new_readme:
-        with open('README_MOZILLA', 'w') as f:
+        f = open('README_MOZILLA', 'w').__enter__()
+        if 1:
             f.write(new_readme)
 
+        f.close()
 def print_info(source, files, disabled, unknown, moz_build_files):
     for key in moz_build_files:
         if key not in files:
diff -up mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_monitor.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_monitor.py
--- mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_monitor.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_monitor.py	2014-09-05 15:26:14.069680997 +0200
@@ -121,8 +121,10 @@ def main(base_dir, adb_cmd='adb'):
   pid_file_path = os.path.join(base_dir, 'LOGCAT_MONITOR_PID')
 
   try:
-    with open(pid_file_path, 'w') as f:
+    f = open(pid_file_path, 'w')
+    if 1:
       f.write(str(os.getpid()))
+    f.close()
     while True:
       for device_id in GetAttachedDevices(adb_cmd):
         if not device_id in devices:
diff -up mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_printer.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_printer.py
--- mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_printer.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/adb_logcat_printer.py	2014-09-05 15:26:14.070681002 +0200
@@ -110,8 +110,10 @@ def GetDeviceLogs(log_filenames, logger)
     logger.debug('%s: %s', device, str(device_files))
     device_file_lines = []
     for cur_file in device_files:
-      with open(cur_file) as f:
+      f = open(cur_file)
+      if 1:
         device_file_lines += [(cur_file, f.read().splitlines())]
+      f.close()
     combined_lines = CombineLogFiles(device_file_lines, logger)
     # Prepend each line with a short unique ID so it's easy to see
     # when the device changes.  We don't use the start of the device
@@ -126,9 +128,11 @@ def ShutdownLogcatMonitor(base_dir, logg
   """Attempts to shutdown adb_logcat_monitor and blocks while waiting."""
   try:
     monitor_pid_path = os.path.join(base_dir, 'LOGCAT_MONITOR_PID')
-    with open(monitor_pid_path) as f:
+    f = open(monitor_pid_path)
+    if 1:
       monitor_pid = int(f.readline())
 
+    f.__exit__(0, 0, 0)
     logger.info('Sending SIGTERM to %d', monitor_pid)
     os.kill(monitor_pid, signal.SIGTERM)
     i = 0
@@ -184,9 +188,11 @@ def main(base_dir, output_file):
     for log in GetDeviceLogs(FindLogFiles(base_dir), logger):
       output_file.write(log)
       output_file.write(separator)
-    with open(os.path.join(base_dir, 'eventlog')) as f:
+    f = open(os.path.join(base_dir, 'eventlog')).__enter__()
+    if 1:
       output_file.write('\nLogcat Monitor Event Log\n')
       output_file.write(f.read())
+    f.close()
   except:
     logger.exception('Unexpected exception')
 
diff -up mozilla-esr31/media/webrtc/trunk/build/android/device_status_check.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/device_status_check.py
--- mozilla-esr31/media/webrtc/trunk/build/android/device_status_check.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/device_status_check.py	2014-09-05 15:26:14.070681002 +0200
@@ -70,8 +70,10 @@ def CheckForMissingDevices(options, adb_
     devices_path = os.path.join(out_dir, file_name)
     devices = []
     try:
-      with open(devices_path) as f:
+      f = open(devices_path)
+      if 1:
         devices = f.read().splitlines()
+      f.close()
     except IOError:
       # Ignore error, file might not exist
       pass
@@ -81,10 +83,12 @@ def CheckForMissingDevices(options, adb_
     path = os.path.join(out_dir, file_name)
     if not os.path.exists(out_dir):
       os.makedirs(out_dir)
-    with open(path, 'w') as f:
+    f = open(path, 'w')
+    if 1:
       # Write devices currently visible plus devices previously seen.
       f.write('\n'.join(set(device_list)))
 
+    f.close()
   last_devices_path = os.path.join(out_dir, '.last_devices')
   last_devices = ReadDeviceList('.last_devices')
 
@@ -128,7 +132,7 @@ def CheckForMissingDevices(options, adb_
         server = smtplib.SMTP('localhost')
         server.sendmail(from_address, [to_address], msg_body)
         server.quit()
-      except Exception as e:
+      except Exception, e:
         print 'Failed to send alert email. Error: %s' % e
   else:
     new_devs = set(adb_online_devs) - set(last_devices)
diff -up mozilla-esr31/media/webrtc/trunk/build/android/emulator.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/emulator.py
--- mozilla-esr31/media/webrtc/trunk/build/android/emulator.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/emulator.py	2014-09-05 15:26:14.070681002 +0200
@@ -275,7 +275,7 @@ class Emulator(object):
         number_of_waits -= 1
         if not number_of_waits:
           break
-      except errors.WaitForResponseTimedOutError as e:
+      except errors.WaitForResponseTimedOutError, e:
         seconds_waited += self._WAITFORDEVICE_TIMEOUT
         adb_cmd = "adb -s %s %s" % (self.device, 'kill-server')
         run_command.RunCommand(adb_cmd)
diff -up mozilla-esr31/media/webrtc/trunk/build/android/lighttpd_server.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/lighttpd_server.py
--- mozilla-esr31/media/webrtc/trunk/build/android/lighttpd_server.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/lighttpd_server.py	2014-09-05 15:26:14.070681002 +0200
@@ -77,15 +77,19 @@ class LighttpdServer(object):
     while True:
       if self.base_config_path:
         # Read the config
-        with codecs.open(self.base_config_path, 'r', 'utf-8') as f:
+        f = codecs.open(self.base_config_path, 'r', 'utf-8').__enter__()
+        if 1:
           config_contents = f.read()
+        f.__exit__(0, 0, 0)
       else:
         config_contents = self._GetDefaultBaseConfig()
       if self.extra_config_contents:
         config_contents += self.extra_config_contents
       # Write out the config, filling in placeholders from the members of |self|
-      with codecs.open(self.config_path, 'w', 'utf-8') as f:
+      f = codecs.open(self.config_path, 'w', 'utf-8').__enter__()
+      if 1:
         f.write(config_contents % self.__dict__)
+      f.__exit__(0, 0, 0)
       if (not os.path.exists(self.lighttpd_path) or
           not os.access(self.lighttpd_path, os.X_OK)):
         raise EnvironmentError(
@@ -133,7 +137,7 @@ class LighttpdServer(object):
           client_error = ('Bad response: %s %s version %s\n  ' %
                           (r.status, r.reason, r.version) +
                           '\n  '.join([': '.join(h) for h in r.getheaders()]))
-      except (httplib.HTTPException, socket.error) as client_error:
+      except (httplib.HTTPException, socket.error), client_error:
         pass  # Probably too quick connecting: try again
       # Check for server startup error messages
       ix = self.process.expect([pexpect.TIMEOUT, pexpect.EOF, '.+'],
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/android_commands.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/android_commands.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/android_commands.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/android_commands.py	2014-09-05 15:26:14.070681002 +0200
@@ -251,7 +251,7 @@ class AndroidCommands(object):
       try:
         self._adb.WaitForDevicePm()
         return  # Success
-      except errors.WaitForResponseTimedOutError as e:
+      except errors.WaitForResponseTimedOutError, e:
         last_err = e
         logging.warning('Restarting and retrying after timeout: %s', e)
         retries -= 1
@@ -624,11 +624,13 @@ class AndroidCommands(object):
 
   def SetFileContents(self, filename, contents):
     """Writes |contents| to the file specified by |filename|."""
-    with tempfile.NamedTemporaryFile() as f:
+    f = tempfile.NamedTemporaryFile().__enter__()
+    if 1:
       f.write(contents)
       f.flush()
       self._adb.Push(f.name, filename)
 
+    f.__exit__(0, 0, 0)
   def RemovePushedFiles(self):
     """Removes all files pushed with PushIfNeeded() from the device."""
     for p in self._pushed_files:
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/device_stats_monitor.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/device_stats_monitor.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/device_stats_monitor.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/device_stats_monitor.py	2014-09-05 15:26:14.070681002 +0200
@@ -92,8 +92,10 @@ class DeviceStatsMonitor(object):
       'irq': 'jiffies',
       'softirq': 'jiffies',
     }
-    with open(output_path, 'w') as f:
+    f = open(output_path, 'w')
+    if 1:
       f.write('display(%d, %s, %s);' % (self._hz, json.dumps(results), units))
+    f.close()
     return 'file://%s?results=file://%s' % (
         DeviceStatsMonitor.RESULT_VIEWER_PATH, urllib.quote(output_path))
 
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/forwarder.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/forwarder.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/forwarder.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/forwarder.py	2014-09-05 15:26:14.071681007 +0200
@@ -117,8 +117,7 @@ class Forwarder(object):
                                        forward_string)
 
     # Read the output of the command to determine which device ports where
-    # forwarded to which host ports (necessary if
-    host_success_re = re.compile('Forwarding device port (\d+) to host (\d+):')
+    # forwarded to which host ports (necessary if host_success_re = re.compile('Forwarding device port (\d+) to host (\d+):')
     host_failure_re = re.compile('Couldn\'t start forwarder server for port '
                                  'spec: (\d+):(\d+)')
     for pair in port_pairs:
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/json_perf_parser.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/json_perf_parser.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/json_perf_parser.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/json_perf_parser.py	2014-09-05 15:26:14.071681007 +0200
@@ -153,8 +153,10 @@ def GetAverageRunInfoFromFile(json_file,
   Returns:
     See GetAverageRunInfo Returns section.
   """
-  with open(json_file, 'r') as f:
+  f = open(json_file, 'r')
+  if 1:
     data = f.read()
     perf = json.loads(data)
 
+  f.close()
   return GetAverageRunInfo(perf, name)
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/perf_tests_helper.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/perf_tests_helper.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/perf_tests_helper.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/perf_tests_helper.py	2014-09-05 15:26:14.071681007 +0200
@@ -67,7 +67,7 @@ def PrintPerfResult(measurement, trace,
     trace_name,
     # Do not show equal sign if the trace is empty. Usually it happens when
     # measurement is enough clear to describe the result.
-    '= ' if trace_name else '',
+    ('', '= ')[trace_name],
     value,
     units)
   if avg:
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/ports.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/ports.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/ports.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/ports.py	2014-09-05 15:26:14.071681007 +0200
@@ -28,12 +28,14 @@ def ResetTestServerPortAllocation():
     Returns True if reset successes. Otherwise returns False.
   """
   try:
-    with open(constants.TEST_SERVER_PORT_FILE, 'w') as fp:
+    fp = open(constants.TEST_SERVER_PORT_FILE, 'w')
+    if 1:
       fp.write('%d' % constants.TEST_SERVER_PORT_FIRST)
+    fp.__exit__(0, 0, 0)
     if os.path.exists(constants.TEST_SERVER_PORT_LOCKFILE):
       os.unlink(constants.TEST_SERVER_PORT_LOCKFILE)
     return True
-  except Exception as e:
+  except Exception, e:
     logging.error(e)
   return False
 
@@ -52,7 +54,8 @@ def AllocateTestServerPort():
     fcntl.flock(fp_lock, fcntl.LOCK_EX)
     # Get current valid port and calculate next valid port.
     assert os.path.exists(constants.TEST_SERVER_PORT_FILE)
-    with open(constants.TEST_SERVER_PORT_FILE, 'r+') as fp:
+    fp = open(constants.TEST_SERVER_PORT_FILE, 'r+').__enter__()
+    if 1:
       port = int(fp.read())
       ports_tried.append(port)
       while IsHostPortUsed(port):
@@ -62,9 +65,10 @@ def AllocateTestServerPort():
           port < constants.TEST_SERVER_PORT_FIRST):
         port = 0
       else:
-        fp.seek(0, os.SEEK_SET)
+        fp.seek(0, 0)
         fp.write('%d' % (port + 1))
-  except Exception as e:
+    fp.close()
+  except Exception, e:
     logging.info(e)
   finally:
     if fp_lock:
@@ -114,7 +118,11 @@ def IsDevicePortUsed(adb, device_port, s
   for single_connect in netstat_results:
     # Column 3 is the local address which we want to check with.
     connect_results = single_connect.split()
-    is_state_match = connect_results[5] == state if state else True
+    is_state_match = None
+    if state:
+      is_state_match = connect_results[5] == state
+    else:
+      is_state_match = True
     if connect_results[3] == base_url and is_state_match:
       return True
   return False
@@ -158,7 +166,7 @@ def IsHttpServerConnectable(host, port,
         client_error = ('Bad response: %s %s version %s\n  ' %
                         (r.status, r.reason, r.version) +
                         '\n  '.join([': '.join(h) for h in r.getheaders()]))
-    except (httplib.HTTPException, socket.error) as e:
+    except (httplib.HTTPException, socket.error), e:
       # Probably too quick connecting: try again.
       exception_error_msgs = traceback.format_exception_only(type(e), e)
       if exception_error_msgs:
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/run_java_tests.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/run_java_tests.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/run_java_tests.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/run_java_tests.py	2014-09-05 15:26:14.071681007 +0200
@@ -382,8 +382,10 @@ class TestRunner(BaseTestRunner):
 
       if self.save_perf_json:
         json_local_file = '/tmp/chromium-android-perf-json-' + raw_test_name
-        with open(json_local_file, 'w') as f:
+        f = open(json_local_file, 'w')
+        if 1:
           f.write(json_string)
+        f.close()
         logging.info('Saving Perf UI JSON from test ' +
                      test + ' to ' + json_local_file)
 
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_info_collection.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_info_collection.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_info_collection.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_info_collection.py	2014-09-05 15:26:14.071681007 +0200
@@ -78,20 +78,17 @@ class TestInfoCollection(object):
 
     # Filter out tests which match neither the requested annotation, nor the
     # requested name filter, if any.
-    available_tests = [t for t in available_tests if
-                       self._AnnotationIncludesTest(t, annotation)]
+    available_tests = [t for t in available_tests if self._AnnotationIncludesTest(t, annotation)]
     if annotation and len(annotation) == 1 and annotation[0] == 'SmallTest':
       tests_without_annotation = [
-          t for t in self.all_tests if
-          not tests_annotations.AnnotatedFunctions.GetTestAnnotations(
+          t for t in self.all_tests if not tests_annotations.AnnotatedFunctions.GetTestAnnotations(
               t.qualified_name)]
       test_names = [t.qualified_name for t in tests_without_annotation]
       logging.warning('The following tests do not contain any annotation. '
                       'Assuming "SmallTest":\n%s',
                       '\n'.join(test_names))
       available_tests += tests_without_annotation
-    available_tests = [t for t in available_tests if
-                       self._NameFilterIncludesTest(t, name_filter)]
+    available_tests = [t for t in available_tests if self._NameFilterIncludesTest(t, name_filter)]
 
     return available_tests
 
diff -up mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_result.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_result.py
--- mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_result.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/pylib/test_result.py	2014-09-05 15:26:14.071681007 +0200
@@ -145,10 +145,12 @@ class TestResults(object):
         os.mkdir(log_file_path)
       full_file_name = os.path.join(log_file_path, test_group)
       if not os.path.exists(full_file_name):
-        with open(full_file_name, 'w') as log_file:
+        log_file = open(full_file_name, 'w')
+        if 1:
           print >> log_file, '\n%s results for %s build %s:' % (
               test_group, os.environ.get('BUILDBOT_BUILDERNAME'),
               os.environ.get('BUILDBOT_BUILDNUMBER'))
+        log_file.close()
       log_contents = ['  %s result : %d tests ran' % (test_suite,
                                                       len(self.ok) +
                                                       len(self.failed) +
@@ -159,16 +161,20 @@ class TestResults(object):
       for (result, count) in content_pairs:
         if count:
           log_contents.append(', %d tests %s' % (count, result))
-      with open(full_file_name, 'a') as log_file:
+      log_file = open(full_file_name, 'a')
+      if 1:
         print >> log_file, ''.join(log_contents)
+      log_file.close()
       content = {'test_group': test_group,
                  'ok': [t.name for t in self.ok],
                  'failed': [t.name for t in self.failed],
                  'crashed': [t.name for t in self.failed],
                  'unknown': [t.name for t in self.unknown],}
-      with open(os.path.join(log_file_path, 'results.json'), 'a') as json_file:
+      json_file = open(os.path.join(log_file_path, 'results.json'), 'a')
+      if 1:
         print >> json_file, json.dumps(content)
 
+      json_file.close()
     # Summarize in the test output.
     summary_string = 'Summary:\n'
     summary_string += 'RAN=%d\n' % (len(self.ok) + len(self.failed) +
diff -up mozilla-esr31/media/webrtc/trunk/build/android/run_tests.py.python3 mozilla-esr31/media/webrtc/trunk/build/android/run_tests.py
--- mozilla-esr31/media/webrtc/trunk/build/android/run_tests.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/android/run_tests.py	2014-09-05 15:26:14.071681007 +0200
@@ -147,7 +147,7 @@ class Xvfb(object):
     self._pid = 0
 
   def _IsLinux(self):
-    """Return True if on Linux; else False."""
+    """Return Trueon Linux; = (False.""", )[]
     return sys.platform.startswith('linux')
 
   def Start(self):
diff -up mozilla-esr31/media/webrtc/trunk/build/escape_unicode.py.python3 mozilla-esr31/media/webrtc/trunk/build/escape_unicode.py
--- mozilla-esr31/media/webrtc/trunk/build/escape_unicode.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/escape_unicode.py	2014-09-05 15:26:14.072681011 +0200
@@ -42,7 +42,8 @@ def main(argv):
 
 def WriteEscapedFile(in_filename, out_filename):
   input_data = codecs.open(in_filename, 'r', 'utf8').read()
-  with codecs.open(out_filename, 'w', 'ascii') as out_file:
+  out_file = codecs.open(out_filename, 'w', 'ascii').__enter__()
+  if 1:
     for i, char in enumerate(input_data):
       if ord(char) > 127:
         out_file.write(repr(char.encode('utf8'))[1:-1])
@@ -52,5 +53,6 @@ def WriteEscapedFile(in_filename, out_fi
         out_file.write(char.encode('ascii'))
 
 
+  out_file.__exit__(0, 0, 0)
 if __name__ == '__main__':
   sys.exit(main(sys.argv))
diff -up mozilla-esr31/media/webrtc/trunk/build/mac/change_mach_o_flags.py.python3 mozilla-esr31/media/webrtc/trunk/build/mac/change_mach_o_flags.py
--- mozilla-esr31/media/webrtc/trunk/build/mac/change_mach_o_flags.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/mac/change_mach_o_flags.py	2014-09-05 15:26:14.072681011 +0200
@@ -103,7 +103,7 @@ def CheckedSeek(file, offset):
   """Seeks the file-like object at |file| to offset |offset| and raises a
   MachOError if anything funny happens."""
 
-  file.seek(offset, os.SEEK_SET)
+  file.seek(offset, 0)
   new_offset = file.tell()
   if new_offset != offset:
     raise MachOError, \
diff -up mozilla-esr31/media/webrtc/trunk/build/mac/tweak_info_plist.py.python3 mozilla-esr31/media/webrtc/trunk/build/mac/tweak_info_plist.py
--- mozilla-esr31/media/webrtc/trunk/build/mac/tweak_info_plist.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/build/mac/tweak_info_plist.py	2014-09-05 15:26:14.072681011 +0200
@@ -125,8 +125,7 @@ def _DoSCMKeys(plist, add_keys):
 
 def _DoPDFKeys(plist, add_keys):
   """Adds PDF support to the document types list. If add_keys is True, it will
-  add the type information dictionary. If it is False, it will remove it if
-  present."""
+  add the type information dictionary. If it is False, it will remove it if present."""
 
   PDF_FILE_EXTENSION = 'pdf'
 
diff -up mozilla-esr31/media/webrtc/trunk/testing/gtest/test/gtest_xml_output_unittest.py.python3 mozilla-esr31/media/webrtc/trunk/testing/gtest/test/gtest_xml_output_unittest.py
--- mozilla-esr31/media/webrtc/trunk/testing/gtest/test/gtest_xml_output_unittest.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/testing/gtest/test/gtest_xml_output_unittest.py	2014-09-05 15:26:14.072681011 +0200
@@ -166,8 +166,7 @@ class GTestXMLOutputUnitTest(gtest_xml_t
   def testTimestampValue(self):
     """Checks whether the timestamp attribute in the XML output is valid.
 
-    Runs a test program that generates an empty XML output, and checks if
-    the timestamp attribute in the testsuites tag is valid.
+    Runs a test program that generates an empty XML output, and checks if the timestamp attribute in the testsuites tag is valid.
     """
     actual = self._GetXmlOutput('gtest_no_test_unittest', 0)
     date_time_str = actual.documentElement.getAttributeNode('timestamp').value
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/common.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/common.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/common.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/common.py	2014-09-05 15:26:14.072681011 +0200
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-from __future__ import with_statement
+
 
 import errno
 import filecmp
@@ -392,15 +392,19 @@ def CopyTool(flavor, out_path):
   # Slurp input file.
   source_path = os.path.join(
       os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix)
-  with open(source_path) as source_file:
+  source_file = open(source_path)
+  if 1:
     source = source_file.readlines()
 
+  source_file.close()
   # Add header and write it out.
   tool_path = os.path.join(out_path, 'gyp-%s-tool' % prefix)
-  with open(tool_path, 'w') as tool_file:
+  tool_file = open(tool_path, 'w')
+  if 1:
     tool_file.write(
         ''.join([source[0], '# Generated by gyp. Do not edit.\n'] + source[1:]))
 
+  tool_file.close()
   # Make file executable.
   os.chmod(tool_path, 0755)
 
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py	2014-09-05 15:26:14.073681016 +0200
@@ -305,7 +305,11 @@ def _BuildCommandLineForRuleRaw(spec, cm
     #              for arguments like "--arg=path" or "/opt:path".
     # If the argument starts with a slash or dash, it's probably a command line
     # switch
-    arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]]
+    arguments = None
+    if (i[:1] in "/-"):
+      arguments = [i
+    else:
+      arguments = _FixPath(i) for i in cmd[1:]]
     arguments = [i.replace('$(InputDir)','%INPUTDIR%') for i in arguments]
     arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
     if quote_cmd:
@@ -695,8 +699,7 @@ def _EscapeVCProjCommandLineArgListItem(
     # .vcproj file will be misinterpreted as part of this item. There is nothing
     # we can do about this. Adding an extra quote would correct the problem in
     # the VCProj but cause the same problem on the final command-line. Moving
-    # the item to the end of the list does works, but that's only possible if
-    # there's only one such item. Let's just warn the user.
+    # the item to the end of the list does works, but that's only possible if # there's only one such item. Let's just warn the user.
     print >> sys.stderr, ('Warning: MSVS may misinterpret the odd number of ' +
                           'quotes in ' + s)
   return s
@@ -1484,7 +1487,7 @@ def _AddActions(actions_to_add, spec, re
   # and does not need to be set up again.
   have_setup_env = set()
   for a in actions:
-    # Attach actions to the gyp file if nothing else is there.
+    # Attach actions to the gyp filenothing = (is there., )[]
     inputs = a.get('inputs') or [relative_path_of_gyp_file]
     attached_to = inputs[0]
     need_setup_env = attached_to not in have_setup_env
@@ -2632,8 +2635,7 @@ def _GetMSBuildAttributes(spec, config,
 
 
 def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file):
-  # TODO(jeanluc) We could optimize out the following and do it only if
-  # there are actions.
+  # TODO(jeanluc) We could optimize out the following and do it only if # there are actions.
   # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'.
   new_paths = []
   cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.'])[0]
@@ -2802,8 +2804,7 @@ def _FinalizeMSBuildSettings(spec, confi
   precompiled_header = configuration.get('msvs_precompiled_header')
 
   # Add the information to the appropriate tool
-  # TODO(jeanluc) We could optimize and generate these settings only if
-  # the corresponding files are found, e.g. don't generate ResourceCompile
+  # TODO(jeanluc) We could optimize and generate these settings only if # the corresponding files are found, e.g. don't generate ResourceCompile
   # if you don't have any resources.
   _ToolAppend(msbuild_settings, 'ClCompile',
               'AdditionalIncludeDirectories', include_dirs)
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py	2014-09-05 15:26:14.073681016 +0200
@@ -233,7 +233,7 @@ class NinjaWriter:
     self.ninja = ninja_syntax.Writer(output_file)
     self.flavor = flavor
     self.abs_build_dir = abs_build_dir
-    self.obj_ext = '.obj' if flavor == 'win' else '.o'
+    self.obj_ext = ('.o', '.obj')[flavor == 'win']
     if flavor == 'win':
       # See docstring of msvs_emulation.GenerateEnvironmentFiles().
       self.win_env = {}
@@ -551,8 +551,11 @@ class NinjaWriter:
       description = self.GenerateDescription('ACTION',
                                              action.get('message', None),
                                              name)
-      is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action)
-                   if self.flavor == 'win' else False)
+      is_cygwin = None
+      if self.flavor == 'win':
+        is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action))
+      else:
+        is_cygwin = (False)
       args = action['action']
       rule_name, _ = self.WriteNewNinjaRule(name, args, description,
                                             is_cygwin, env=env)
@@ -589,8 +592,11 @@ class NinjaWriter:
           'RULE',
           rule.get('message', None),
           ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name)
-      is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule)
-                   if self.flavor == 'win' else False)
+      is_cygwin = None
+      if self.flavor == 'win':
+        is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule))
+      else:
+        is_cygwin = (False)
       rule_name, args = self.WriteNewNinjaRule(
           name, args, description, is_cygwin, env=env)
 
@@ -1204,7 +1210,7 @@ class NinjaWriter:
     if self.flavor == 'win':
       rspfile = rule_name + '.$unique_name.rsp'
       # The cygwin case handles this inside the bash sub-shell.
-      run_in = '' if is_cygwin else ' ' + self.build_to_base
+      run_in = (' ' + self.build_to_base, '' )[is_cygwin] 
       if is_cygwin:
         rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine(
             args, self.build_to_base)
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/xcode.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/xcode.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/xcode.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/xcode.py	2014-09-05 15:26:14.073681016 +0200
@@ -1090,8 +1090,7 @@ exit 1
       else:
         pbxp.AddOrGetFileInRootGroup(source)
 
-    # Add "mac_bundle_resources" and "mac_framework_private_headers" if
-    # it's a bundle of any type.
+    # Add "mac_bundle_resources" and "mac_framework_private_headers" if # it's a bundle of any type.
     if is_bundle:
       for resource in tgt_mac_bundle_resources:
         (resource_root, resource_extension) = posixpath.splitext(resource)
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/input.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/input.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/input.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/input.py	2014-09-05 15:26:14.074681021 +0200
@@ -12,7 +12,7 @@ from compiler.ast import Stmt
 import compiler
 import copy
 import gyp.common
-import multiprocessing
+#import multiprocessing
 import optparse
 import os.path
 import re
@@ -997,8 +997,7 @@ def ProcessConditionsInDict(the_dict, ph
   # Each item in a conditions list consists of cond_expr, a string expression
   # evaluated as the condition, and true_dict, a dict that will be merged into
   # the_dict if cond_expr evaluates to true.  Optionally, a third item,
-  # false_dict, may be present.  false_dict is merged into the_dict if
-  # cond_expr evaluates to false.
+  # false_dict, may be present.  false_dict is merged into the_dict if # cond_expr evaluates to false.
   #
   # Any dict merged into the_dict will be recursively processed for nested
   # conditionals and other expansions, also according to phase, immediately
@@ -1202,8 +1201,7 @@ def ProcessVariablesAndConditionsInDict(
   # Recurse into child dicts, or process child lists which may result in
   # further recursion into descendant dicts.
   for key, value in the_dict.iteritems():
-    # Skip "variables" and string values, which were already processed if
-    # present.
+    # Skip "variables" and string values, which were already processed if # present.
     if key == 'variables' or isinstance(value, str):
       continue
     if isinstance(value, dict):
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py	2014-09-05 15:26:14.074681021 +0200
@@ -170,7 +170,7 @@ class MsvsSettings(object):
     replacements = {
         '$(VSInstallDir)': self.vs_version.Path(),
         '$(VCInstallDir)': os.path.join(self.vs_version.Path(), 'VC') + '\\',
-        '$(OutDir)\\': base_to_build + '\\' if base_to_build else '',
+        '$(OutDir)\\': base_to_build + ('', '\\')[base_to_build],
         '$(IntDir)': '$!INTERMEDIATE_DIR',
         '$(InputPath)': '${source}',
         '$(InputName)': '${root}',
@@ -182,8 +182,7 @@ class MsvsSettings(object):
     # set. This happens when the SDK is sync'd via src-internal, rather than
     # by typical end-user installation of the SDK. If it's not set, we don't
     # want to leave the unexpanded variable in the path, so simply strip it.
-    replacements['$(DXSDK_DIR)'] = self.dxsdk_dir if self.dxsdk_dir else ''
-    replacements['$(WDK_DIR)'] = self.wdk_dir if self.wdk_dir else ''
+    replacements['$(DXSDK_DIR)'] = ('', self.wdk_dir)[self.wdk_dir]
     return replacements
 
   def ConvertVSMacros(self, s, base_to_build=None, config=None):
@@ -192,8 +191,10 @@ class MsvsSettings(object):
     return ExpandMacros(s, env)
 
   def AdjustLibraries(self, libraries):
-    """Strip -l from library if it's specified with that."""
-    return [lib[2:] if lib.startswith('-l') else lib for lib in libraries]
+    """Strip -l from library if it's specified with that.""" if lib.startswith('-l'):
+   return [lib[2:]
+ else:
+   return lib for lib in libraries]
 
   def _GetAndMunge(self, field, path, default, prefix, append, map):
     """Retrieve a value from |field| at |path| or return |default|. If
@@ -269,7 +270,7 @@ class MsvsSettings(object):
     if it's not overridden."""
     config = self._RealConfig(config)
     type = self.spec['type']
-    root = 'VCLibrarianTool' if type == 'static_library' else 'VCLinkerTool'
+    root = ('VCLinkerTool', 'VCLibrarianTool')[type == 'static_library']
     # TODO(scottmg): Handle OutputDirectory without OutputFile.
     output_file = self._Setting((root, 'OutputFile'), config)
     if output_file:
@@ -597,7 +598,7 @@ class PrecompiledHeader(object):
     if not source or not header:
       return []
     ext = os.path.splitext(source)[1]
-    lang = 'c' if ext == '.c' else 'cc'
+    lang = ('cc', 'c')[ext == '.c']
     return [(self._PchOutput(), '/Yc' + header, lang, source)]
 
 
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSUserFile.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSUserFile.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSUserFile.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSUserFile.py	2014-09-05 15:26:14.074681021 +0200
@@ -81,8 +81,7 @@ class Writer(object):
 
     Args:
       command: command line to run.  First element in the list is the
-        executable.  All elements of the command will be quoted if
-        necessary.
+        executable.  All elements of the command will be quoted if necessary.
       working_directory: other files which may trigger the rule. (optional)
     """
     command = _QuoteWin32CommandLineArgs(command)
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/SCons.py	2014-09-05 15:26:14.074681021 +0200
@@ -34,7 +34,7 @@ class TargetBase(object):
     """
     Returns the full name of the product being built:
 
-      * Uses 'product_name' if it's set, else prefix + 'target_name'.
+      * Uses 'product_name'it's set, = (prefix + 'target_name'., )[]
       * Prepends 'product_dir' if set.
       * Appends SCons suffix variables for the target type (or
         product_extension).
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/win_tool.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/win_tool.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/win_tool.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/win_tool.py	2014-09-05 15:26:14.074681021 +0200
@@ -96,7 +96,8 @@ class WinTool(object):
     '   Creating library ui.dll.lib and object ui.dll.exp'
     This happens when there are exports from the dll or exe.
     """
-    with LinkLock():
+    LinkLock().__enter__()
+    if 1:
       env = self._GetEnv(arch)
       popen = subprocess.Popen(args, shell=True, env=env,
                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -106,6 +107,7 @@ class WinTool(object):
           print line
       return popen.returncode
 
+    LinkLock().__exit__(0, 0, 0)
   def ExecManifestWrapper(self, arch, *args):
     """Run manifest tool with environment set. Strip out undesirable warning
     (some XML blocks are recognized by the OS loader, but not the manifest
@@ -184,7 +186,11 @@ class WinTool(object):
     for |arch|. If |dir| is supplied, use that as the working directory."""
     env = self._GetEnv(arch)
     args = open(rspfile).read()
-    dir = dir[0] if dir else None
+    dir = None
+    if dir:
+      dir = dir[0]
+    else:
+      dir = None
     popen = subprocess.Popen(args, shell=True, env=env, cwd=dir)
     popen.wait()
     return popen.returncode
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py	2014-09-05 15:26:14.074681021 +0200
@@ -415,7 +415,7 @@ class XcodeSettings(object):
       return None
     install_base = self.GetPerTargetSetting(
         'DYLIB_INSTALL_NAME_BASE',
-        default='/Library/Frameworks' if self._IsBundle() else '/usr/local/lib')
+        default=('/usr/local/lib', '/Library/Frameworks')[self._IsBundle()])
     return install_base
 
   def _StandardizePath(self, path):
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/pylib/gyp/xcodeproj_file.py	2014-09-05 15:26:14.075681026 +0200
@@ -216,8 +216,7 @@ class XCObject(object):
              is_strong: If property_type is an XCObject subclass, is_strong
                         is True to assert that this class "owns," or serves
                         as parent, to the property value (or, if is_list is
-                        True, values).  is_strong must be False if
-                        property_type is not an XCObject subclass.
+                        True, values).  is_strong must be False if property_type is not an XCObject subclass.
              is_required: True if the property is required for the class.
                           Note that is_required being True does not preclude
                           an empty string ("", in the case of property_type
@@ -954,8 +953,7 @@ class XCHierarchicalElement(XCObject):
 
     XCHierarchicalElements are special.  Generally, their hashes shouldn't
     change if the paths don't change.  The normal XCObject implementation of
-    Hashables adds a hashable for each object, which means that if
-    the hierarchical structure changes (possibly due to changes caused when
+    Hashables adds a hashable for each object, which means that if the hierarchical structure changes (possibly due to changes caused when
     TakeOverOnlyChild runs and encounters slight changes in the hierarchy),
     the hashes will change.  For example, if a project file initially contains
     a/b/f1 and a/b becomes collapsed into a/b, f1 will have a single parent
@@ -2132,8 +2130,7 @@ class XCTarget(XCRemoteObject):
 
     # Set up additional defaults not expressed in the schema.  If a "name"
     # property was supplied, set "productName" if it is not present.  Also set
-    # the "PRODUCT_NAME" build setting in each configuration, but only if
-    # the setting is not present in any build configuration.
+    # the "PRODUCT_NAME" build setting in each configuration, but only if # the setting is not present in any build configuration.
     if 'name' in self._properties:
       if not 'productName' in self._properties:
         self.SetProperty('productName', self._properties['name'])
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/library/gyptest-shared-obj-install-path.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/library/gyptest-shared-obj-install-path.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/library/gyptest-shared-obj-install-path.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/library/gyptest-shared-obj-install-path.py	2014-09-05 15:26:14.075681026 +0200
@@ -10,7 +10,7 @@ their install location rather than by th
 """
 
 # Python 2.5 needs this for the with statement.
-from __future__ import with_statement
+
 
 import os
 import TestGyp
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCmd.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCmd.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCmd.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCmd.py	2014-09-05 15:26:14.075681026 +0200
@@ -1127,8 +1127,10 @@ class TestCmd(object):
         file = self.canonicalize(file)
         if mode[0] != 'r':
             raise ValueError, "mode must begin with 'r'"
-        with open(file, mode) as f:
+        f = open(file, mode)
+        if 1:
             result = f.read()
+        f.__exit__(0, 0, 0)
         return result
 
     def rmdir(self, dir):
@@ -1587,9 +1589,11 @@ class TestCmd(object):
         file = self.canonicalize(file)
         if mode[0] != 'w':
             raise ValueError, "mode must begin with 'w'"
-        with open(file, mode) as f:
+        f = open(file, mode).__enter__()
+        if 1:
             f.write(content)
 
+        f.close()
 # Local Variables:
 # tab-width:4
 # indent-tabs-mode:nil
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCommon.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCommon.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCommon.py.python3	2014-08-25 15:17:20.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/lib/TestCommon.py	2014-09-05 15:26:14.075681026 +0200
@@ -499,7 +499,8 @@ class TestCommon(TestCmd):
         """Runs the program under test, checking that the test succeeded.
 
         The arguments are the same as the base TestCmd.run() method,
-        with the addition of:
+        the addition of.__enter__()
+        if 1:
 
                 options Extra options that get appended to the beginning
                         of the arguments.
@@ -516,6 +517,7 @@ class TestCommon(TestCmd):
                         command.  A value of None means don't
                         test exit status.
 
+        the addition of.__exit__(0, 0, 0)
         By default, this expects a successful exit (status = 0), does
         not test standard output (stdout = None), and expects that error
         output is empty (stderr = "").
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/make/gyptest-noload.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/make/gyptest-noload.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/make/gyptest-noload.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/make/gyptest-noload.py	2014-09-05 15:26:14.076681031 +0200
@@ -10,7 +10,7 @@ optional.
 """
 
 # Python 2.5 needs this for the with statement.
-from __future__ import with_statement
+
 
 import os
 import TestGyp
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py	2014-09-05 15:26:14.076681031 +0200
@@ -27,7 +27,7 @@ test.run_gyp('action_dependencies.gyp',
 chdir = 'relocate/src'
 test.relocate('src', chdir)
 
-objext = '.obj' if sys.platform == 'win32' else '.o'
+objext = ('.o', '.obj')[sys.platform == 'win32']
 
 test.build('action_dependencies.gyp',
            os.path.join('obj', 'b.b' + objext),
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py	2014-09-05 15:26:14.076681031 +0200
@@ -19,7 +19,7 @@ import TestGyp
 
 test = TestGyp.TestGyp(formats=['ninja'])
 test.run_gyp('chained-dependency.gyp')
-objext = '.obj' if sys.platform == 'win32' else '.o'
+objext = ('.o', '.obj')[sys.platform == 'win32']
 test.build('chained-dependency.gyp',
            os.path.join('obj', 'chained.chained' + objext))
 # The test passes if the .o file builds successfully.
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-cl-function-level-linking.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-cl-function-level-linking.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-cl-function-level-linking.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-cl-function-level-linking.py	2014-09-05 15:26:14.076681031 +0200
@@ -29,7 +29,7 @@ if sys.platform == 'win32':
       test.fail_test()
 
   def Object(proj, obj):
-    sep = '.' if test.format == 'ninja' else '\\'
+    sep = ('\\', '.')[test.format == 'ninja']
     return 'obj\\%s%s%s' % (proj, sep, obj)
 
   look_for = '''COMDAT; sym= "int __cdecl comdat_function'''
diff -up mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-link-debug-info.py.python3 mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-link-debug-info.py
--- mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-link-debug-info.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/tools/gyp/test/win/gyptest-link-debug-info.py	2014-09-05 15:26:14.076681031 +0200
@@ -19,7 +19,7 @@ if sys.platform == 'win32':
   test.run_gyp('debug-info.gyp', chdir=CHDIR)
   test.build('debug-info.gyp', test.ALL, chdir=CHDIR)
 
-  suffix = '.exe.pdb' if test.format == 'ninja' else '.pdb'
+  suffix = ('.pdb', '.exe.pdb')[test.format == 'ninja']
   test.built_file_must_not_exist('test_debug_off%s' % suffix, chdir=CHDIR)
   test.built_file_must_exist('test_debug_on%s' % suffix, chdir=CHDIR)
 
diff -up mozilla-esr31/media/webrtc/trunk/webrtc/test/buildbot_tests.py.python3 mozilla-esr31/media/webrtc/trunk/webrtc/test/buildbot_tests.py
--- mozilla-esr31/media/webrtc/trunk/webrtc/test/buildbot_tests.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/webrtc/test/buildbot_tests.py	2014-09-05 15:26:14.076681031 +0200
@@ -128,7 +128,7 @@ def main():
     print 'Running: %s' % ' '.join(cmd_line)
     try:
       subprocess.check_call(cmd_line, env=env)
-    except subprocess.CalledProcessError as e:
+    except subprocess.CalledProcessError, e:
       print >> sys.stderr, ('An error occurred during test execution: return '
                             'code: %d' % e.returncode)
       return -1
diff -up mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_decoder.py.python3 mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_decoder.py
--- mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_decoder.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_decoder.py	2014-09-05 15:26:14.076681031 +0200
@@ -39,7 +39,7 @@ def convert_yuv_to_png_files(yuv_file_na
   """
   size_string = str(yuv_frame_width) + 'x' + str(yuv_frame_height)
   output_files_pattern = os.path.join(output_directory, 'frame_%04d.png')
-  ffmpeg_executable = 'ffmpeg.exe' if sys.platform == 'win32' else 'ffmpeg'
+  ffmpeg_executable = ('ffmpeg', 'ffmpeg.exe')[sys.platform == 'win32']
   if ffmpeg_dir:
     ffmpeg_executable = os.path.join(ffmpeg_dir, ffmpeg_executable)
   command = [ffmpeg_executable, '-s', '%s' % size_string, '-i', '%s'
@@ -78,7 +78,7 @@ def decode_frames(input_directory, zxing
   Return:
     (bool): True if the decoding went without errors.
   """
-  zxing_executable = 'zxing.exe' if sys.platform == 'win32' else 'zxing'
+  zxing_executable = ('zxing', 'zxing.exe')[sys.platform == 'win32']
   if zxing_dir:
     zxing_executable = os.path.join(zxing_dir, zxing_executable)
   print 'Decoding barcodes from PNG files with %s...' % zxing_executable
diff -up mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_encoder.py.python3 mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_encoder.py
--- mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_encoder.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_encoder.py	2014-09-05 15:26:14.076681031 +0200
@@ -58,7 +58,7 @@ def generate_upca_barcodes(number_of_bar
     try:
       helper_functions.run_shell_command(
           command, fail_msg=('Error during barcode %s generation' % content))
-    except helper_functions.HelperError as err:
+    except helper_functions.HelperError, err:
       print >> sys.stderr, err
       errors = True
   return not errors
@@ -110,7 +110,7 @@ def _convert_to_yuv_and_delete(output_di
         command, fail_msg=('Error during PNG to YUV conversion of %s' %
                            file_name))
     os.remove(file_name)
-  except helper_functions.HelperError as err:
+  except helper_functions.HelperError, err:
     print >> sys.stderr, err
     return False
   return True
@@ -153,7 +153,7 @@ def _add_to_file_and_delete(output_file,
   input_file.close()
   try:
     os.remove(file_name)
-  except OSError as e:
+  except OSError, e:
     print >> sys.stderr, 'Error deleting file %s.\nError: %s' % (file_name, e)
     return False
   return True
@@ -330,8 +330,7 @@ def _main():
   --output_yuv=<path and name_of_output_file>
   """
   options = _parse_args()
-  # The barcodes with will be different than the base frame width only if
-  # explicitly specified at the command line.
+  # The barcodes with will be different than the base frame width only if # explicitly specified at the command line.
   if options.barcode_width == _DEFAULT_BARCODE_WIDTH:
     options.barcode_width = options.base_frame_width
   # If the user provides a value for the barcodes YUV video file, we will keep
diff -up mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/build_zxing.py.python3 mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/build_zxing.py
--- mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/build_zxing.py.python3	2014-08-25 15:17:21.000000000 +0200
+++ mozilla-esr31/media/webrtc/trunk/webrtc/tools/barcode_tools/build_zxing.py	2014-09-05 15:26:14.076681031 +0200
@@ -27,7 +27,7 @@ def run_ant_build_command(path_to_ant_bu
     if process.returncode != 0:
       print >> sys.stderr, 'Failed to execute: %s' % ' '.join(cmd)
     return process.returncode
-  except subprocess.CalledProcessError as e:
+  except subprocess.CalledProcessError, e:
     print >> sys.stderr, 'Failed to execute: %s.\nCause: %s' % (' '.join(cmd),
                                                                 e)
     return -1
diff -up mozilla-esr31/mobile/android/debug_sign_tool.py.python3 mozilla-esr31/mobile/android/debug_sign_tool.py
--- mozilla-esr31/mobile/android/debug_sign_tool.py.python3	2014-08-25 15:17:22.000000000 +0200
+++ mozilla-esr31/mobile/android/debug_sign_tool.py	2014-09-05 15:26:14.077681036 +0200
@@ -55,7 +55,7 @@ class DebugKeystore:
                 subprocess.check_call(args)
             else:
                 subprocess.check_output(args)
-        except OSError as ex:
+        except OSError, ex:
             if ex.errno != errno.ENOENT:
                 raise
             raise Exception("Could not find executable '%s'" % args[0])
@@ -72,12 +72,12 @@ class DebugKeystore:
         contains = True
         try:
             self._check(args)
-        except subprocess.CalledProcessError as e:
+        except subprocess.CalledProcessError, e:
             contains = False
         if self.verbose:
             log.info('Keystore %s %s alias %s' %
                      (self.keystore,
-                      'contains' if contains else 'does not contain',
+                      ('does not contain', 'contains')[contains],
                       self.alias))
         return contains
 
@@ -85,7 +85,7 @@ class DebugKeystore:
         try:
             path = os.path.dirname(self.keystore)
             os.makedirs(path)
-        except OSError as exception:
+        except OSError, exception:
             if exception.errno != errno.EEXIST:
                 raise
 
@@ -167,7 +167,7 @@ def main():
     if args.force:
         try:
             keystore.create_alias_in_keystore()
-        except subprocess.CalledProcessError as e:
+        except subprocess.CalledProcessError, e:
             log.error('Failed to force-create alias %s in keystore %s' %
                       (keystore.alias, keystore.keystore))
             log.error(e)
@@ -176,7 +176,7 @@ def main():
     for apk in args.apks:
         try:
             keystore.sign(apk)
-        except subprocess.CalledProcessError as e:
+        except subprocess.CalledProcessError, e:
             log.error('Failed to sign %s', apk)
             log.error(e)
             return 1
diff -up mozilla-esr31/mozglue/build/fixcrt.py.python3 mozilla-esr31/mozglue/build/fixcrt.py
--- mozilla-esr31/mozglue/build/fixcrt.py.python3	2014-08-25 15:17:23.000000000 +0200
+++ mozilla-esr31/mozglue/build/fixcrt.py	2014-09-05 15:26:14.077681036 +0200
@@ -2,13 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 
 with open('crtdll.obj', 'rb') as infile:
   data = infile.read()
-  with open('crtdll_fixed.obj', 'wb') as outfile:
+  outfile = open('crtdll_fixed.obj', 'wb')
+  if 1:
     # for Win32
     data = data.replace('__imp__free', '__imp__frex')
     # for Win64
     data = data.replace('__imp_free', '__imp_frex')
     outfile.write(data)
+  outfile.close()
+
diff -up mozilla-esr31/netwerk/protocol/http/make_incoming_tables.py.python3 mozilla-esr31/netwerk/protocol/http/make_incoming_tables.py
--- mozilla-esr31/netwerk/protocol/http/make_incoming_tables.py.python3	2014-08-25 15:17:23.000000000 +0200
+++ mozilla-esr31/netwerk/protocol/http/make_incoming_tables.py	2014-09-05 15:26:14.077681036 +0200
@@ -84,7 +84,7 @@ def output_table(table, name_suffix=''):
         elif t is not None:
             output_table(t, '%s_%s' % (name_suffix, i))
 
-    tablename = 'HuffmanIncoming%s' % (name_suffix if name_suffix else 'Root',)
+    tablename = 'HuffmanIncoming%s' % (('Root', name_suffix)[name_suffix],)
     entriestable = tablename.replace('HuffmanIncoming', 'HuffmanIncomingEntries')
     sys.stdout.write('static HuffmanIncomingEntry %s[] = {\n' % (entriestable,))
     prefix_len = 0
diff -up mozilla-esr31/other-licenses/ply/ply/yacc.py.python3 mozilla-esr31/other-licenses/ply/ply/yacc.py
--- mozilla-esr31/other-licenses/ply/ply/yacc.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/other-licenses/ply/ply/yacc.py	2014-09-05 15:26:14.077681036 +0200
@@ -98,7 +98,7 @@ else:
 try:
     MAXINT = sys.maxint
 except AttributeError:
-    MAXINT = sys.maxsize
+    MAXINT = sys.maxint
 
 # Python 2.x/3.0 compatibility.
 def load_ply_lex():
@@ -501,8 +501,7 @@ class LRParser:
                 #
                 # In addition to pushing the error token, we call call
                 # the user defined p_error() function if this is the
-                # first syntax error.  This function is only called if
-                # errorcount == 0.
+                # first syntax error.  This function is only called if # errorcount == 0.
                 if errorcount == 0 or self.errorok:
                     errorcount = error_count
                     self.errorok = 0
@@ -774,8 +773,7 @@ class LRParser:
                 #
                 # In addition to pushing the error token, we call call
                 # the user defined p_error() function if this is the
-                # first syntax error.  This function is only called if
-                # errorcount == 0.
+                # first syntax error.  This function is only called if # errorcount == 0.
                 if errorcount == 0 or self.errorok:
                     errorcount = error_count
                     self.errorok = 0
@@ -1029,8 +1027,7 @@ class LRParser:
                 #
                 # In addition to pushing the error token, we call call
                 # the user defined p_error() function if this is the
-                # first syntax error.  This function is only called if
-                # errorcount == 0.
+                # first syntax error.  This function is only called if # errorcount == 0.
                 if errorcount == 0 or self.errorok:
                     errorcount = error_count
                     self.errorok = 0
diff -up mozilla-esr31/python/blessings/blessings/__init__.py.python3 mozilla-esr31/python/blessings/blessings/__init__.py
--- mozilla-esr31/python/blessings/blessings/__init__.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/blessings/blessings/__init__.py	2014-09-05 15:26:14.078681041 +0200
@@ -1,4 +1,4 @@
-from collections import defaultdict
+from mycollections import defaultdict
 import curses
 from curses import tigetstr, tigetnum, setupterm, tparm
 from fcntl import ioctl
@@ -73,9 +73,11 @@ class Terminal(object):
         if stream is None:
             stream = sys.__stdout__
         try:
-            stream_descriptor = (stream.fileno() if hasattr(stream, 'fileno')
-                                                 and callable(stream.fileno)
-                                 else None)
+            stream_descriptor = None
+            if hasattr(stream, 'fileno') and callable(stream.fileno):
+               stream_descriptor = (stream.fileno())
+            else:
+               stream_descriptor = (None)
         except IOUnsupportedOperation:
             stream_descriptor = None
 
@@ -85,9 +87,11 @@ class Terminal(object):
         # The desciptor to direct terminal initialization sequences to.
         # sys.__stdout__ seems to always have a descriptor of 1, even if output
         # is redirected.
-        self._init_descriptor = (sys.__stdout__.fileno()
-                                 if stream_descriptor is None
-                                 else stream_descriptor)
+        self._init_descriptor = None
+        if stream_descriptor is None:
+          self._init_descriptor = (sys.__stdout__.fileno())
+        else:
+          self._init_descriptor = (stream_descriptor)
         if self._does_styling:
             # Make things like tigetstr() work. Explicit args make setupterm()
             # work even when -s is passed to nosetests. Lean toward sending
@@ -154,7 +158,11 @@ class Terminal(object):
         Return values are always Unicode.
 
         """
-        resolution = self._resolve_formatter(attr) if self._does_styling else NullCallableString()
+        resolution = None
+        if self._does_styling:
+          resolution = self._resolve_formatter(attr)
+        else:
+          resolution = NullCallableString()
         setattr(self, attr, resolution)  # Cache capability codes.
         return resolution
 
@@ -200,11 +208,13 @@ class Terminal(object):
         there, then return the cursor to its original position::
 
             term = Terminal()
-            with term.location(2, 5):
+            term.location(2, 5).__enter__()
+            if 1:
                 print 'Hello, world!'
                 for x in xrange(10):
                     print 'I can do it %i times!' % x
 
+            term.location(2, 5).__exit__(0, 0, 0)
         Specify ``x`` to move to a certain column, ``y`` to move to a certain
         row, or both.
 
@@ -256,7 +266,10 @@ class Terminal(object):
         # access to it.
         colors = tigetnum('colors')  # Returns -1 if no color support, -2 if no such cap.
         #self.__dict__['colors'] = ret  # Cache it. It's not changing. (Doesn't work.)
-        return colors if colors >= 0 else 0
+        if colors >= 0:
+          return colors
+        else:
+          return 0
 
     def _resolve_formatter(self, attr):
         """Resolve a sugary or plain capability name, color, or compound formatting function name into a callable capability."""
@@ -297,11 +310,18 @@ class Terminal(object):
         # yellow when a terminal supports setf/setb rather than setaf/setab?
         # I'll be blasted if I can find any documentation. The following
         # assumes it does.
-        color_cap = (self._background_color if 'on_' in color else
-                     self._foreground_color)
+        color_cap = None
+        if 'on_' in color:
+          color_cap = (self._background_color)
+        else:
+          color_cap = (self._foreground_color)
         # curses constants go up to only 7, so add an offset to get at the
         # bright colors at 8-15:
-        offset = 8 if 'bright_' in color else 0
+        offset = None
+        if 'bright_' in color:
+          offset = 8
+        else:
+          offset = 0
         base_color = color.rsplit('_', 1)[-1]
         return self._formatting_string(
             color_cap(getattr(curses, 'COLOR_' + base_color.upper()) + offset))
@@ -353,8 +373,7 @@ class ParametrizingString(unicode):
             # 3. However, appear to be a plain Unicode string otherwise so
             # concats work.
             parametrized = tparm(self.encode('utf-8'), *args).decode('utf-8')
-            return (parametrized if self._normal is None else
-                    FormattingString(parametrized, self._normal))
+            return ((FormattingString(parametrized, self._normal), parametrized)[self._normal is None])
         except curses.error:
             # Catch "must call (at least) setupterm() first" errors, as when
             # running simply `nosetests` (without progressive) on nose-
diff -up mozilla-esr31/python/blessings/blessings/tests.py.python3 mozilla-esr31/python/blessings/blessings/tests.py
--- mozilla-esr31/python/blessings/blessings/tests.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/blessings/blessings/tests.py	2014-09-05 15:26:14.078681041 +0200
@@ -9,7 +9,7 @@ All we require from the host machine is
 xterm-256color exists.
 
 """
-from __future__ import with_statement  # Make 2.5-compatible
+  # Make 2.5-compatible
 from curses import tigetstr, tparm
 from functools import partial
 from StringIO import StringIO
@@ -83,9 +83,11 @@ def test_location():
     """Make sure ``location()`` does what it claims."""
     t = TestTerminal(stream=StringIO(), force_styling=True)
 
-    with t.location(3, 4):
+    t.location(3, 4).__enter__()
+    if 1:
         t.stream.write(u'hi')
 
+    t.location(3, 4).__exit__(0, 0, 0)
     eq_(t.stream.getvalue(), unicode_cap('sc') +
                              unicode_parm('cup', 4, 3) +
                              u'hi' +
@@ -95,8 +97,10 @@ def test_location():
 def test_horizontal_location():
     """Make sure we can move the cursor horizontally without changing rows."""
     t = TestTerminal(stream=StringIO(), force_styling=True)
-    with t.location(x=5):
+    t.location(x=5).__enter__()
+    if 1:
         pass
+    t.location(x=5).__exit__(0, 0, 0)
     eq_(t.stream.getvalue(), unicode_cap('sc') +
                              unicode_parm('hpa', 5) +
                              unicode_cap('rc'))
diff -up mozilla-esr31/python/codegen/makeutils.py.python3 mozilla-esr31/python/codegen/makeutils.py
--- mozilla-esr31/python/codegen/makeutils.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/codegen/makeutils.py	2014-09-05 15:26:14.078681041 +0200
@@ -17,11 +17,12 @@ def writeMakeDependOutput(filename):
     if dir and not os.path.exists(dir):
         try:
             os.makedirs(dir)
-        except OSError as error:
+        except OSError, error:
             if error.errno != errno.EEXIST:
                 raise
 
-    with open(filename, 'w') as f:
+    f = open(filename, 'w')
+    if 1:
         if len(targets) > 0:
             f.write("%s:" % makeQuote(targets[0]))
             for filename in dependencies:
@@ -32,3 +33,5 @@ def writeMakeDependOutput(filename):
             for filename in dependencies:
                 f.write('%s:\n' % filename)
 
+    f.close()
+
diff -up mozilla-esr31/python/configobj/configobj.py.python3 mozilla-esr31/python/configobj/configobj.py
--- mozilla-esr31/python/configobj/configobj.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/configobj/configobj.py	2014-09-05 15:26:14.078681041 +0200
@@ -587,8 +587,7 @@ class Section(dict):
         (We have to special case 'Section' instances - which are also dicts)
         
         Keys must be strings.
-        Values need only be strings (or lists of strings) if
-        ``main.stringify`` is set.
+        Values need only be strings (or lists of strings) if ``main.stringify`` is set.
         
         ``unrepr`` must be set when setting a value to a dictionary, without
         creating a new sub-section.
diff -up mozilla-esr31/python/mach_commands.py.python3 mozilla-esr31/python/mach_commands.py
--- mozilla-esr31/python/mach_commands.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach_commands.py	2014-09-05 15:26:14.078681041 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import argparse
 import glob
@@ -106,4 +110,7 @@ class MachCommands(MachCommandBase):
             if stop and return_code > 0:
                 return 1
 
-        return 0 if return_code == 0 else 1
+        if return_code == 0:
+          return 0
+        else:
+          return 1
diff -up mozilla-esr31/python/mach/mach/base.py.python3 mozilla-esr31/python/mach/mach/base.py
--- mozilla-esr31/python/mach/mach/base.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/base.py	2014-09-05 15:26:14.078681041 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 
 class CommandContext(object):
diff -up mozilla-esr31/python/mach/mach/commands/commandinfo.py.python3 mozilla-esr31/python/mach/mach/commands/commandinfo.py
--- mozilla-esr31/python/mach/mach/commands/commandinfo.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/commands/commandinfo.py	2014-09-05 15:26:14.078681041 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 from mach.decorators import (
     CommandProvider,
diff -up mozilla-esr31/python/mach/mach/commands/settings.py.python3 mozilla-esr31/python/mach/mach/commands/settings.py
--- mozilla-esr31/python/mach/mach/commands/settings.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/commands/settings.py	2014-09-05 15:26:14.079681046 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 from textwrap import TextWrapper
 
diff -up mozilla-esr31/python/mach/mach/config.py.python3 mozilla-esr31/python/mach/mach/config.py
--- mozilla-esr31/python/mach/mach/config.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/config.py	2014-09-05 15:26:14.079681046 +0200
@@ -25,7 +25,7 @@ msgfmt binary to perform this conversion
 can be done via the write_pot() of ConfigSettings.
 """
 
-from __future__ import unicode_literals
+
 
 import collections
 import gettext
@@ -93,7 +93,7 @@ class BooleanType(ConfigType):
 
     @staticmethod
     def to_config(value):
-        return 'true' if value else 'false'
+        return ('false', 'true')[value]
 
 
 class IntegerType(ConfigType):
@@ -227,7 +227,11 @@ class ConfigProvider(object):
             raise Exception('Setting has already been registered: %s.%s' % (
                 section, option))
 
-        domain = domain if domain is not None else section
+        domain = None
+        if domain is not None:
+          domain = domain
+        else:
+          domain = section
 
         meta = {
             'short': '%s.short' % option,
diff -up mozilla-esr31/python/mach/mach/decorators.py.python3 mozilla-esr31/python/mach/mach/decorators.py
--- mozilla-esr31/python/mach/mach/decorators.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/decorators.py	2014-09-05 15:26:14.079681046 +0200
@@ -2,19 +2,19 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import collections
 import inspect
 import types
 
-from .base import (
+from base import (
     MachError,
     MethodHandler
 )
 
-from .config import ConfigProvider
-from .registrar import Registrar
+from config import ConfigProvider
+from registrar import Registrar
 
 
 def CommandProvider(cls):
diff -up mozilla-esr31/python/mach/mach/dispatcher.py.python3 mozilla-esr31/python/mach/mach/dispatcher.py
--- mozilla-esr31/python/mach/mach/dispatcher.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/dispatcher.py	2014-09-05 15:26:14.079681046 +0200
@@ -2,14 +2,14 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import argparse
 import sys
 
 from operator import itemgetter
 
-from .base import (
+from base import (
     NoCommandError,
     UnknownCommandError,
     UnrecognizedArgumentError,
diff -up mozilla-esr31/python/mach/mach/logging.py.python3 mozilla-esr31/python/mach/mach/logging.py
--- mozilla-esr31/python/mach/mach/logging.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/logging.py	2014-09-05 15:26:14.079681046 +0200
@@ -6,18 +6,25 @@
 # support for a structured logging framework built on top of Python's built-in
 # logging framework.
 
-from __future__ import absolute_import, unicode_literals
+
 
 try:
     import blessings
 except ImportError:
     blessings = None
 
-import json
-import logging
+import simplejson as json
+import rhrebase
+logging = rhrebase.import_non_local('logging')
+
+import logging as moz_logging
 import sys
 import time
 
+class NullHandler(logging.Handler):
+    def emit(self, record):
+        pass
+logging.NullHandler = NullHandler
 
 def format_seconds(total):
     """Format number of seconds to MM:SS.DD form."""
@@ -145,7 +152,7 @@ class LoggingManager(object):
         # Installing NullHandler on the root logger ensures that *all* log
         # messages have at least one handler. This prevents Python from
         # complaining about "no handlers could be found for logger XXX."
-        self.root_logger.addHandler(logging.NullHandler())
+        #FIXME? self.root_logger.addHandler(NullHandler())
 
         self.mach_logger = logging.getLogger('mach')
         self.mach_logger.setLevel(logging.DEBUG)
@@ -175,7 +182,7 @@ class LoggingManager(object):
         """Enable JSON logging on the specified file object."""
 
         # Configure the consumer of structured messages.
-        handler = logging.StreamHandler(stream=fh)
+        handler = logging.StreamHandler(fh)
         handler.setFormatter(StructuredJSONFormatter())
         handler.setLevel(logging.DEBUG)
 
@@ -197,7 +204,7 @@ class LoggingManager(object):
                 write_interval=write_interval, write_times=write_times)
             formatter.set_terminal(self.terminal)
 
-        handler = logging.StreamHandler(stream=fh)
+        handler = logging.StreamHandler(fh)
         handler.setFormatter(formatter)
         handler.setLevel(level)
 
diff -up mozilla-esr31/python/mach/mach/main.py.python3 mozilla-esr31/python/mach/mach/main.py
--- mozilla-esr31/python/mach/mach/main.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/main.py	2014-09-05 15:26:14.079681046 +0200
@@ -5,7 +5,7 @@
 # This module provides functionality for the command-line build tool
 # (mach). It is packaged as a module because everything is a library.
 
-from __future__ import absolute_import, print_function, unicode_literals
+, print_function, unicode_literals
 from collections import Iterable
 
 import argparse
@@ -18,7 +18,7 @@ import traceback
 import uuid
 import sys
 
-from .base import (
+from base import (
     CommandContext,
     MachError,
     NoCommandError,
@@ -26,16 +26,16 @@ from .base import (
     UnrecognizedArgumentError,
 )
 
-from .decorators import (
+from decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
 
-from .config import ConfigSettings
-from .dispatcher import CommandAction
-from .logging import LoggingManager
-from .registrar import Registrar
+from config import ConfigSettings
+from dispatcher import CommandAction
+from logging import LoggingManager
+from registrar import Registrar
 
 
 
@@ -288,9 +288,16 @@ To see more help for a specific command,
         # up with UnicodeEncodeError as soon as it encounters a non-ASCII
         # character in a unicode instance. We simply install a wrapper around
         # the streams and restore once we have finished.
-        stdin = sys.stdin if stdin is None else stdin
-        stdout = sys.stdout if stdout is None else stdout
-        stderr = sys.stderr if stderr is None else stderr
+        stdin = (sys.stdin, stdin)[stdin]
+        stdout = (sys.stdout, stdout)[stdout]
+        stderr = (sys.stderr, stderr)[stderr]
+        #else:
+        #  stdin = stdout
+        #stderr = None
+        #if stderr is None:
+        #  stderr = sys.stderr
+        #else:
+        #  stderr = stderr
 
         orig_stdin = sys.stdin
         orig_stdout = sys.stdout
@@ -315,7 +322,7 @@ To see more help for a specific command,
             print('mach interrupted by signal or user action. Stopping.')
             return 1
 
-        except Exception as e:
+        except Exception, e:
             # _run swallows exceptions in invoked handlers and converts them to
             # a proper exit code. So, the only scenario where we should get an
             # exception here is if _run itself raises. If _run raises, that's a
@@ -359,10 +366,10 @@ To see more help for a specific command,
         except NoCommandError:
             print(NO_COMMAND_ERROR)
             return 1
-        except UnknownCommandError as e:
+        except UnknownCommandError, e:
             print(UNKNOWN_COMMAND_ERROR % (e.verb, e.command))
             return 1
-        except UnrecognizedArgumentError as e:
+        except UnrecognizedArgumentError, e:
             print(UNRECOGNIZED_ARGUMENT_ERROR % (e.command,
                 ' '.join(e.arguments)))
             return 1
@@ -421,9 +428,9 @@ To see more help for a specific command,
             assert isinstance(result, (int, long))
 
             return result
-        except KeyboardInterrupt as ki:
+        except KeyboardInterrupt, ki:
             raise ki
-        except Exception as e:
+        except Exception, e:
             exc_type, exc_value, exc_tb = sys.exc_info()
 
             # The first frame is us and is never used.
diff -up mozilla-esr31/python/mach/mach/mixin/logging.py.python3 mozilla-esr31/python/mach/mach/mixin/logging.py
--- mozilla-esr31/python/mach/mach/mixin/logging.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/mixin/logging.py	2014-09-05 15:26:14.079681046 +0200
@@ -2,10 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, unicode_literals
 
-import logging
 
+#import logging
+from rhrebase import import_non_local
+logging = import_non_local('logging')
 
 class LoggingMixin(object):
     """Provides functionality to control logging."""
@@ -50,6 +51,7 @@ class LoggingMixin(object):
         self.log(logging.DEBUG, 'login', {'username': 'johndoe'},
             'User login: {username}')
         """
-        self._logger.log(level, format_str,
-            extra={'action': action, 'params': params})
+        self._logger.log(level, format_str)
+            #extra={'action': action, 'params': params})
+            #extra={'action': action, 'params': params})
 
diff -up mozilla-esr31/python/mach/mach/mixin/process.py.python3 mozilla-esr31/python/mach/mach/mixin/process.py
--- mozilla-esr31/python/mach/mach/mixin/process.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/mixin/process.py	2014-09-05 15:26:14.079681046 +0200
@@ -4,16 +4,18 @@
 
 # This module provides mixins to perform process execution.
 
-from __future__ import absolute_import, unicode_literals
 
-import logging
+
+#import logging
+from rhrebase import import_non_local
+logging = import_non_local('logging')
 import os
 import subprocess
 import sys
 
 from mozprocess.processhandler import ProcessHandlerMixin
 
-from .logging import LoggingMixin
+from logging import LoggingMixin
 
 
 # Perform detection of operating system environment. This is used by command
@@ -36,7 +38,7 @@ if os.environ.get('MSYSTEM', None) == 'M
     if not _current_shell.lower().endswith('.exe'):
         _current_shell += '.exe'
 
-
+#print dir(logging)
 class ProcessExecutionMixin(LoggingMixin):
     """Mix-in that provides process execution functionality."""
 
diff -up mozilla-esr31/python/mach/mach/registrar.py.python3 mozilla-esr31/python/mach/mach/registrar.py
--- mozilla-esr31/python/mach/mach/registrar.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/registrar.py	2014-09-05 15:26:14.080681051 +0200
@@ -2,9 +2,9 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
 
-from .base import MachError
+
+from base import MachError
 
 
 class MachRegistrar(object):
diff -up mozilla-esr31/python/mach/mach/terminal.py.python3 mozilla-esr31/python/mach/mach/terminal.py
--- mozilla-esr31/python/mach/mach/terminal.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/terminal.py	2014-09-05 15:26:14.080681051 +0200
@@ -8,7 +8,11 @@ All the terminal interaction code is con
 one place, away from code that is commonly looked at.
 """
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import logging
 import sys
diff -up mozilla-esr31/python/mach/mach/test/common.py.python3 mozilla-esr31/python/mach/mach/test/common.py
--- mozilla-esr31/python/mach/mach/test/common.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/common.py	2014-09-05 15:26:14.080681051 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from StringIO import StringIO
 import os
diff -up mozilla-esr31/python/mach/mach/test/providers/basic.py.python3 mozilla-esr31/python/mach/mach/test/providers/basic.py
--- mozilla-esr31/python/mach/mach/test/providers/basic.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/providers/basic.py	2014-09-05 15:26:14.080681051 +0200
@@ -1,7 +1,7 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import unicode_literals
+
 
 from mach.decorators import (
     CommandProvider,
diff -up mozilla-esr31/python/mach/mach/test/providers/conditions_invalid.py.python3 mozilla-esr31/python/mach/mach/test/providers/conditions_invalid.py
--- mozilla-esr31/python/mach/mach/test/providers/conditions_invalid.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/providers/conditions_invalid.py	2014-09-05 15:26:14.080681051 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from mach.decorators import (
     CommandProvider,
diff -up mozilla-esr31/python/mach/mach/test/providers/conditions.py.python3 mozilla-esr31/python/mach/mach/test/providers/conditions.py
--- mozilla-esr31/python/mach/mach/test/providers/conditions.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/providers/conditions.py	2014-09-05 15:26:14.080681051 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from mach.decorators import (
     CommandProvider,
diff -up mozilla-esr31/python/mach/mach/test/providers/throw.py.python3 mozilla-esr31/python/mach/mach/test/providers/throw.py
--- mozilla-esr31/python/mach/mach/test/providers/throw.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/providers/throw.py	2014-09-05 15:26:14.080681051 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import time
 
diff -up mozilla-esr31/python/mach/mach/test/test_conditions.py.python3 mozilla-esr31/python/mach/mach/test/test_conditions.py
--- mozilla-esr31/python/mach/mach/test/test_conditions.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/test_conditions.py	2014-09-05 15:26:14.080681051 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 
diff -up mozilla-esr31/python/mach/mach/test/test_config.py.python3 mozilla-esr31/python/mach/mach/test/test_config.py
--- mozilla-esr31/python/mach/mach/test/test_config.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/test_config.py	2014-09-05 15:26:14.080681051 +0200
@@ -1,7 +1,7 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import unicode_literals
+
 
 import sys
 import unittest
@@ -67,10 +67,12 @@ class TestConfigProvider(unittest.TestCa
         self.assertIn('baz', s['foo'])
 
     def test_duplicate_option(self):
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             ProviderDuplicate.register_settings()
 
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
 class Provider2(ConfigProvider):
     @classmethod
     def _register_settings(cls):
@@ -117,56 +119,76 @@ class TestConfigSettings(unittest.TestCa
         a = s.a
 
         # Assigning an undeclared setting raises.
-        with self.assertRaises(KeyError):
+        self.assertRaises(KeyError).__enter__()
+        if 1:
             a.undefined = True
 
-        with self.assertRaises(KeyError):
+        self.assertRaises(KeyError).__exit__(0, 0, 0)
+        self.assertRaises(KeyError).__enter__()
+        if 1:
             a['undefined'] = True
 
+        self.assertRaises(KeyError).__exit__(0, 0, 0)
         # Basic type validation.
         a.string = 'foo'
         a.string = 'foo'
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             a.string = False
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         a.boolean = True
         a.boolean = False
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             a.boolean = 'foo'
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         a.pos_int = 5
         a.pos_int = 0
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             a.pos_int = -1
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             a.pos_int = 'foo'
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         a.int = 5
         a.int = 0
         a.int = -5
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             a.int = 1.24
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             a.int = 'foo'
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         a.abs_path = '/home/gps'
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             a.abs_path = 'home/gps'
 
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
         a.rel_path = 'home/gps'
         a.rel_path = './foo/bar'
         a.rel_path = 'foo.c'
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             a.rel_path = '/foo/bar'
 
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
         a.path = '/home/gps'
         a.path = 'foo.c'
         a.path = 'foo/bar'
diff -up mozilla-esr31/python/mach/mach/test/test_entry_point.py.python3 mozilla-esr31/python/mach/mach/test/test_entry_point.py
--- mozilla-esr31/python/mach/mach/test/test_entry_point.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/test_entry_point.py	2014-09-05 15:26:14.081681055 +0200
@@ -1,7 +1,7 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import unicode_literals
+
 
 import imp
 import os
@@ -43,9 +43,11 @@ class TestEntryPoints(TestBase):
 
         mock.return_value = [Entry(['providers'])]
         # Mach error raised due to conditions_invalid.py
-        with self.assertRaises(MachError):
+        self.assertRaises(MachError).__enter__()
+        if 1:
             self._run_mach()
 
+        self.assertRaises(MachError).__exit__(0, 0, 0)
     @patch('pkg_resources.iter_entry_points')
     def test_load_entry_point_from_file(self, mock):
         mock.return_value = [Entry([os.path.join('providers', 'basic.py')])]
diff -up mozilla-esr31/python/mach/mach/test/test_error_output.py.python3 mozilla-esr31/python/mach/mach/test/test_error_output.py
--- mozilla-esr31/python/mach/mach/test/test_error_output.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/test_error_output.py	2014-09-05 15:26:14.081681055 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from mach.main import (
     COMMAND_ERROR,
diff -up mozilla-esr31/python/mach/mach/test/test_logger.py.python3 mozilla-esr31/python/mach/mach/test/test_logger.py
--- mozilla-esr31/python/mach/mach/test/test_logger.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mach/mach/test/test_logger.py	2014-09-05 15:26:14.081681055 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import, unicode_literals
+
 
 import logging
 import time
diff -up mozilla-esr31/python/mock-1.0.0/mock.py.python3 mozilla-esr31/python/mock-1.0.0/mock.py
--- mozilla-esr31/python/mock-1.0.0/mock.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mock-1.0.0/mock.py	2014-09-05 15:26:14.081681055 +0200
@@ -871,8 +871,7 @@ class NonCallableMock(Base):
         """assert the mock has been called with the specified arguments.
 
         The assert passes if the mock has *ever* been called, unlike
-        `assert_called_with` and `assert_called_once_with` that only pass if
-        the call is the most recent one."""
+        `assert_called_with` and `assert_called_once_with` that only pass if the call is the most recent one."""
         kall = call(*args, **kwargs)
         if kall not in self.call_args_list:
             expected_string = self._format_mock_call_signature(args, kwargs)
@@ -1438,9 +1437,11 @@ def _patch_multiple(target, spec=None, c
     patched (either as an object or a string to fetch the object by importing)
     and keyword arguments for the patches::
 
-        with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):
+        patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two').__enter__()
+        if 1:
             ...
 
+        patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two').__exit__(0, 0, 0)
     Use `DEFAULT` as the value if you want `patch.multiple` to create
     mocks for you. In this case the created mocks are passed into a decorated
     function by keyword, and a dictionary is returned when `patch.multiple` is
@@ -1517,8 +1518,7 @@ def patch(
     then the mock with be created with a spec from the object being replaced.
     All attributes of the mock will also have the spec of the corresponding
     attribute of the object being replaced. Methods and functions being
-    mocked will have their arguments checked and will raise a `TypeError` if
-    they are called with the wrong signature. For mocks replacing a class,
+    mocked will have their arguments checked and will raise a `TypeError` if they are called with the wrong signature. For mocks replacing a class,
     their return value (the 'instance') will have the same spec as the class.
 
     Instead of `autospec=True` you can pass `autospec=some_object` to use an
@@ -1578,9 +1578,11 @@ class _patch_dict(object):
     `patch.dict` can also be called with arbitrary keyword arguments to set
     values in the dictionary::
 
-        with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):
+        patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()).__enter__()
+        if 1:
             ...
 
+        patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()).__exit__(0, 0, 0)
     `patch.dict` can be used as a context manager, decorator or class
     decorator. When used as a class decorator `patch.dict` honours
     `patch.TEST_PREFIX` for choosing which methods to wrap.
diff -up mozilla-esr31/python/mock-1.0.0/tests/support_with.py.python3 mozilla-esr31/python/mock-1.0.0/tests/support_with.py
--- mozilla-esr31/python/mock-1.0.0/tests/support_with.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mock-1.0.0/tests/support_with.py	2014-09-05 15:26:14.081681055 +0200
@@ -1,4 +1,4 @@
-from __future__ import with_statement
+
 
 import sys
 
@@ -88,6 +88,8 @@ except ImportError:
 
 def examine_warnings(func):
     def wrapper():
-        with catch_warnings(record=True) as ws:
+        ws = catch_warnings(record=True).__enter__()
+        if 1:
             func(ws)
+        ws.__exit__(0, 0, 0)
     return wrapper
diff -up mozilla-esr31/python/mock-1.0.0/tests/testmagicmethods.py.python3 mozilla-esr31/python/mock-1.0.0/tests/testmagicmethods.py
--- mozilla-esr31/python/mock-1.0.0/tests/testmagicmethods.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mock-1.0.0/tests/testmagicmethods.py	2014-09-05 15:26:14.081681055 +0200
@@ -329,7 +329,7 @@ class TestMockingMagicMethods(unittest2.
         else:
             # in Python 3 oct and hex use __index__
             # so these tests are for __index__ in py3k
-            self.assertEqual(oct(mock), '0o1')
+            self.assertEqual(oct(mock), '01')
         self.assertEqual(hex(mock), '0x1')
         # how to test __sizeof__ ?
 
diff -up mozilla-esr31/python/mock-1.0.0/tests/_testwith.py.python3 mozilla-esr31/python/mock-1.0.0/tests/_testwith.py
--- mozilla-esr31/python/mock-1.0.0/tests/_testwith.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mock-1.0.0/tests/_testwith.py	2014-09-05 15:26:14.082681060 +0200
@@ -2,7 +2,7 @@
 # E-mail: fuzzyman AT voidspace DOT org DOT uk
 # http://www.voidspace.org.uk/python/mock/
 
-from __future__ import with_statement
+
 
 from tests.support import unittest2, is_instance
 
@@ -18,16 +18,20 @@ something_else  = sentinel.SomethingElse
 class WithTest(unittest2.TestCase):
 
     def test_with_statement(self):
-        with patch('tests._testwith.something', sentinel.Something2):
+        patch('tests._testwith.something', sentinel.Something2).__enter__()
+        if 1:
             self.assertEqual(something, sentinel.Something2, "unpatched")
+        patch('tests._testwith.something', sentinel.Something2).__exit__(0, 0, 0)
         self.assertEqual(something, sentinel.Something)
 
 
     def test_with_statement_exception(self):
         try:
-            with patch('tests._testwith.something', sentinel.Something2):
+            patch('tests._testwith.something', sentinel.Something2).__enter__()
+            if 1:
                 self.assertEqual(something, sentinel.Something2, "unpatched")
                 raise Exception('pow')
+            patch('tests._testwith.something', sentinel.Something2).__exit__(0, 0, 0)
         except Exception:
             pass
         else:
@@ -36,10 +40,12 @@ class WithTest(unittest2.TestCase):
 
 
     def test_with_statement_as(self):
-        with patch('tests._testwith.something') as mock_something:
+        mock_something = patch('tests._testwith.something').__enter__()
+        if 1:
             self.assertEqual(something, mock_something, "unpatched")
             self.assertTrue(is_instance(mock_something, MagicMock),
                             "patching wrong type")
+        mock_something.__exit__(0, 0, 0)
         self.assertEqual(something, sentinel.Something)
 
 
@@ -47,27 +53,33 @@ class WithTest(unittest2.TestCase):
         class Foo(object):
             something = 'foo'
         original = Foo.something
-        with patch.object(Foo, 'something'):
+        patch.object(Foo, 'something').__enter__()
+        if 1:
             self.assertNotEqual(Foo.something, original, "unpatched")
+        patch.object(Foo, 'something').__exit__(0, 0, 0)
         self.assertEqual(Foo.something, original)
 
 
     def test_with_statement_nested(self):
-        with catch_warnings(record=True):
+        catch_warnings(record=True).__enter__()
+        if 1:
             # nested is deprecated in Python 2.7
             with nested(patch('tests._testwith.something'),
                     patch('tests._testwith.something_else')) as (mock_something, mock_something_else):
                 self.assertEqual(something, mock_something, "unpatched")
                 self.assertEqual(something_else, mock_something_else,
                                  "unpatched")
+        catch_warnings(record=True).__exit__(0, 0, 0)
         self.assertEqual(something, sentinel.Something)
         self.assertEqual(something_else, sentinel.SomethingElse)
 
 
     def test_with_statement_specified(self):
-        with patch('tests._testwith.something', sentinel.Patched) as mock_something:
+        mock_something = patch('tests._testwith.something', sentinel.Patched).__enter__()
+        if 1:
             self.assertEqual(something, mock_something, "unpatched")
             self.assertEqual(mock_something, sentinel.Patched, "wrong patch")
+        mock_something.__exit__(0, 0, 0)
         self.assertEqual(something, sentinel.Something)
 
 
@@ -77,8 +89,10 @@ class WithTest(unittest2.TestCase):
         mock.__exit__ = Mock()
         mock.__exit__.return_value = False
 
-        with mock as m:
+        m = mock.__enter__()
+        if 1:
             self.assertEqual(m, mock.__enter__.return_value)
+        m.__exit__(0, 0, 0)
         mock.__enter__.assert_called_with()
         mock.__exit__.assert_called_with(None, None, None)
 
@@ -86,49 +100,63 @@ class WithTest(unittest2.TestCase):
     def test_context_manager_with_magic_mock(self):
         mock = MagicMock()
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             with mock:
                 'foo' + 3
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         mock.__enter__.assert_called_with()
         self.assertTrue(mock.__exit__.called)
 
 
     def test_with_statement_same_attribute(self):
-        with patch('tests._testwith.something', sentinel.Patched) as mock_something:
+        mock_something = patch('tests._testwith.something', sentinel.Patched).__enter__()
+        if 1:
             self.assertEqual(something, mock_something, "unpatched")
 
-            with patch('tests._testwith.something') as mock_again:
+            mock_again = patch('tests._testwith.something').__enter__()
+            if 1:
                 self.assertEqual(something, mock_again, "unpatched")
 
+            mock_again.__exit__(0, 0, 0)
             self.assertEqual(something, mock_something,
                              "restored with wrong instance")
 
+        mock_something.__exit__(0, 0, 0)
         self.assertEqual(something, sentinel.Something, "not restored")
 
 
     def test_with_statement_imbricated(self):
-        with patch('tests._testwith.something') as mock_something:
+        mock_something = patch('tests._testwith.something').__enter__()
+        if 1:
             self.assertEqual(something, mock_something, "unpatched")
 
-            with patch('tests._testwith.something_else') as mock_something_else:
+            mock_something_else = patch('tests._testwith.something_else').__enter__()
+            if 1:
                 self.assertEqual(something_else, mock_something_else,
                                  "unpatched")
 
+            mock_something_else.__exit__(0, 0, 0)
+        mock_something.__exit__(0, 0, 0)
         self.assertEqual(something, sentinel.Something)
         self.assertEqual(something_else, sentinel.SomethingElse)
 
 
     def test_dict_context_manager(self):
         foo = {}
-        with patch.dict(foo, {'a': 'b'}):
+        patch.dict(foo, {'a': 'b'}).__enter__()
+        if 1:
             self.assertEqual(foo, {'a': 'b'})
+        patch.dict(foo, {'a': 'b'}).__exit__(0, 0, 0)
         self.assertEqual(foo, {})
 
-        with self.assertRaises(NameError):
+        self.assertRaises(NameError).__enter__()
+        if 1:
             with patch.dict(foo, {'a': 'b'}):
                 self.assertEqual(foo, {'a': 'b'})
                 raise NameError('Konrad')
 
+        self.assertRaises(NameError).__exit__(0, 0, 0)
         self.assertEqual(foo, {})
 
 
@@ -137,20 +165,26 @@ class TestMockOpen(unittest2.TestCase):
 
     def test_mock_open(self):
         mock = mock_open()
-        with patch('%s.open' % __name__, mock, create=True) as patched:
+        patched = patch('%s.open' % __name__, mock, create=True).__enter__()
+        if 1:
             self.assertIs(patched, mock)
             open('foo')
 
+        patched.__exit__(0, 0, 0)
         mock.assert_called_once_with('foo')
 
 
     def test_mock_open_context_manager(self):
         mock = mock_open()
         handle = mock.return_value
-        with patch('%s.open' % __name__, mock, create=True):
-            with open('foo') as f:
+        patch('%s.open' % __name__, mock, create=True).__enter__()
+        if 1:
+            f = open('foo')
+            if 1:
                 f.read()
 
+            f.close()
+        patch('%s.open' % __name__, mock, create=True).__exit__(0, 0, 0)
         expected_calls = [call('foo'), call().__enter__(), call().read(),
                           call().__exit__(None, None, None)]
         self.assertEqual(mock.mock_calls, expected_calls)
@@ -161,19 +195,23 @@ class TestMockOpen(unittest2.TestCase):
         mock = MagicMock()
         mock_open(mock)
 
-        with patch('%s.open' % __name__, mock, create=True) as patched:
+        patched = patch('%s.open' % __name__, mock, create=True).__enter__()
+        if 1:
             self.assertIs(patched, mock)
             open('foo')
 
+        patched.__exit__(0, 0, 0)
         mock.assert_called_once_with('foo')
 
 
     def test_read_data(self):
         mock = mock_open(read_data='foo')
-        with patch('%s.open' % __name__, mock, create=True):
+        patch('%s.open' % __name__, mock, create=True).__enter__()
+        if 1:
             h = open('bar')
             result = h.read()
 
+        patch('%s.open' % __name__, mock, create=True).__exit__(0, 0, 0)
         self.assertEqual(result, 'foo')
 
 
diff -up mozilla-esr31/python/mozboot/mozboot/base.py.python3 mozilla-esr31/python/mozboot/mozboot/base.py
--- mozilla-esr31/python/mozboot/mozboot/base.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozboot/mozboot/base.py	2014-09-05 15:26:14.082681060 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import re
diff -up mozilla-esr31/python/mozboot/mozboot/mach_commands.py.python3 mozilla-esr31/python/mozboot/mozboot/mach_commands.py
--- mozilla-esr31/python/mozboot/mozboot/mach_commands.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozboot/mozboot/mach_commands.py	2014-09-05 15:26:14.082681060 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this,
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from mach.decorators import (
     CommandArgument,
diff -up mozilla-esr31/python/mozboot/mozboot/osx.py.python3 mozilla-esr31/python/mozboot/mozboot/osx.py
--- mozilla-esr31/python/mozboot/mozboot/osx.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozboot/mozboot/osx.py	2014-09-05 15:26:14.082681060 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import re
@@ -197,7 +201,7 @@ class OSXBootstrapper(BaseBootstrapper):
             try:
                 output = self.check_output([select, '--print-path'],
                     stderr=subprocess.STDOUT)
-            except subprocess.CalledProcessError as e:
+            except subprocess.CalledProcessError, e:
                 # This seems to appear on fresh OS X machines before any Xcode
                 # has been installed. It may only occur on OS X 10.9 and later.
                 if 'unable to get active developer directory' in e.output:
@@ -218,13 +222,13 @@ class OSXBootstrapper(BaseBootstrapper):
         try:
             output = self.check_output(['/usr/bin/xcrun', 'clang'],
                 stderr=subprocess.STDOUT)
-        except subprocess.CalledProcessError as e:
+        except subprocess.CalledProcessError, e:
             if 'license' in e.output:
                 xcodebuild = self.which('xcodebuild')
                 try:
                     subprocess.check_call([xcodebuild, '-license'],
                         stderr=subprocess.STDOUT)
-                except subprocess.CalledProcessError as e:
+                except subprocess.CalledProcessError, e:
                     if 'requires admin privileges' in e.output:
                         self.run_as_root([xcodebuild, '-license'])
 
@@ -372,12 +376,14 @@ class OSXBootstrapper(BaseBootstrapper):
     def install_homebrew(self):
         print(PACKAGE_MANAGER_INSTALL % ('Homebrew', 'Homebrew', 'Homebrew', 'brew'))
         bootstrap = urlopen(url=HOMEBREW_BOOTSTRAP, timeout=20).read()
-        with tempfile.NamedTemporaryFile() as tf:
+        tf = tempfile.NamedTemporaryFile().__enter__()
+        if 1:
             tf.write(bootstrap)
             tf.flush()
 
             subprocess.check_call(['ruby', tf.name])
 
+        tf.__exit__(0, 0, 0)
     def install_macports(self):
         url = MACPORTS_URL.get(self.minor_version, None)
         if not url:
@@ -386,12 +392,14 @@ class OSXBootstrapper(BaseBootstrapper):
 
         print(PACKAGE_MANAGER_INSTALL % ('MacPorts', 'MacPorts', 'MacPorts', 'port'))
         pkg = urlopen(url=url, timeout=300).read()
-        with tempfile.NamedTemporaryFile(suffix='.pkg') as tf:
+        tf = tempfile.NamedTemporaryFile(suffix='.pkg').__enter__()
+        if 1:
             tf.write(pkg)
             tf.flush()
 
             self.run_as_root(['installer', '-pkg', tf.name, '-target', '/'])
 
+        tf.__exit__(0, 0, 0)
     def _update_package_manager(self):
         if self.package_manager == 'homebrew':
             subprocess.check_call([self.brew, '-v', 'update'])
@@ -406,7 +414,7 @@ class OSXBootstrapper(BaseBootstrapper):
             try:
                 subprocess.check_output([self.brew, '-v', 'upgrade', package],
                     stderr=subprocess.STDOUT)
-            except subprocess.CalledProcessError as e:
+            except subprocess.CalledProcessError, e:
                 if 'already installed' not in e.output:
                     raise
         else:
diff -up mozilla-esr31/python/mozbuild/dumbmake/dumbmake.py.python3 mozilla-esr31/python/mozbuild/dumbmake/dumbmake.py
--- mozilla-esr31/python/mozbuild/dumbmake/dumbmake.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/dumbmake/dumbmake.py	2014-09-05 15:26:14.082681060 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from collections import OrderedDict
 from itertools import groupby
diff -up mozilla-esr31/python/mozbuild/dumbmake/test/test_dumbmake.py.python3 mozilla-esr31/python/mozbuild/dumbmake/test/test_dumbmake.py
--- mozilla-esr31/python/mozbuild/dumbmake/test/test_dumbmake.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/dumbmake/test/test_dumbmake.py	2014-09-05 15:26:14.082681060 +0200
@@ -1,7 +1,7 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import unicode_literals
+
 
 import unittest
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/action/buildlist.py.python3 mozilla-esr31/python/mozbuild/mozbuild/action/buildlist.py
--- mozilla-esr31/python/mozbuild/mozbuild/action/buildlist.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/action/buildlist.py	2014-09-05 15:26:14.082681060 +0200
@@ -7,7 +7,11 @@ if the entry does not already exist.
 
 Usage: buildlist.py <filename> <entry> [<entry> ...]
 '''
-from __future__ import print_function
+def print24(msg, file=None, end="\n"):
+  if file:
+    file.write(msg + end)
+  else:
+    sys.stdout.write(msg + end)
 
 import sys
 import os
@@ -29,15 +33,17 @@ def addEntriesToListFile(listFile, entri
     for e in entries:
       if e not in existing:
         existing.add(e)
-    with open(listFile, 'w') as f:
+    f = open(listFile, 'w')
+    if 1:
       f.write("\n".join(sorted(existing))+"\n")
+    f.close()
   finally:
     lock = None
 
 
 def main(args):
     if len(args) < 2:
-        print("Usage: buildlist.py <list file> <entry> [<entry> ...]",
+        print24("Usage: buildlist.py <list file> <entry> [<entry> ...]",
             file=sys.stderr)
         return 1
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/action/cl.py.python3 mozilla-esr31/python/mozbuild/mozbuild/action/cl.py
--- mozilla-esr31/python/mozbuild/mozbuild/action/cl.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/action/cl.py	2014-09-05 15:26:14.083681065 +0200
@@ -110,9 +110,11 @@ def InvokeClWithDependencyGeneration(cmd
                  # cost of masking failure to create the directory.  We'll just
                  # die on the next line though, so it's not that much of a loss.
 
-    with open(depstarget, "w") as f:
+    f = open(depstarget, "w")
+    if 1:
         mk.dump(f)
 
+    f.close()
     return 0
 
 def main(args):
diff -up mozilla-esr31/python/mozbuild/mozbuild/action/link_deps.py.python3 mozilla-esr31/python/mozbuild/mozbuild/action/link_deps.py
--- mozilla-esr31/python/mozbuild/mozbuild/action/link_deps.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/action/link_deps.py	2014-09-05 15:26:14.083681065 +0200
@@ -1,3 +1,57 @@
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -68,7 +122,7 @@ build/binaries.
 import argparse
 import os
 import sys
-from collections import OrderedDict
+from mycollections import OrderedDict
 from mozbuild.makeutil import (
     Makefile,
     read_dep_makefile,
@@ -140,7 +194,14 @@ class DependencyLinker(Makefile):
             if self._group == Grouping.BY_DEPFILE:
                 if depfile not in rules:
                     rules[depfile] = self.create_rule([depfile])
-                rules[depfile].add_dependencies(d if d not in self._targets else self._targets[d][0] for d in deps)
+                my_deps = []
+                for d in deps:
+                  if d not in self._targets:
+                    my_deps.append(d)
+                  else:
+                    my_deps.append(self._targets[d][0])
+                rules[depfile].add_dependencies(my_deps)
+                #rules[depfile].add_dependencies(dd not in self._targets = (self._targets[d][0] for d in deps), )[]
             elif self._group == Grouping.ALL_TARGETS:
                 if 'all' not in rules:
                     rules['all'] = self.create_rule()
diff -up mozilla-esr31/python/mozbuild/mozbuild/action/process_install_manifest.py.python3 mozilla-esr31/python/mozbuild/mozbuild/action/process_install_manifest.py
--- mozilla-esr31/python/mozbuild/mozbuild/action/process_install_manifest.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/action/process_install_manifest.py	2014-09-05 15:26:14.083681065 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import argparse
 import sys
@@ -10,8 +14,8 @@ from mozpack.copier import FileCopier
 from mozpack.manifests import InstallManifest
 
 
-COMPLETE = 'From {dest}: Kept {existing} existing; Added/updated {updated}; ' \
-    'Removed {rm_files} files and {rm_dirs} directories.'
+COMPLETE = 'From %(dest)s: Kept %(existing)s existing; Added/updated %(updated)s; ' \
+    'Removed %(rm_files)s files and %(rm_dirs)s directories.'
 
 
 def process_manifest(destdir, paths,
@@ -49,12 +53,19 @@ def main(argv):
         remove_unaccounted=not args.no_remove,
         remove_all_directory_symlinks=not args.no_remove_all_directory_symlinks,
         remove_empty_directories=not args.no_remove_empty_directories)
-
-    print(COMPLETE.format(dest=args.destdir,
+    parms = dict()
+    parms = {"dest":args.destdir,
+        "existing" : result.existing_files_count,
+        "updated" : result.updated_files_count,
+        "rm_files" : result.removed_files_count,
+        "rm_dirs" : result.removed_directories_count}
+    
+    #print(COMPLETE % parms)
+    '''(dest=args.destdir,
         existing=result.existing_files_count,
         updated=result.updated_files_count,
         rm_files=result.removed_files_count,
         rm_dirs=result.removed_directories_count))
-
+    '''
 if __name__ == '__main__':
     main(sys.argv[1:])
diff -up mozilla-esr31/python/mozbuild/mozbuild/action/xpidl-process.py.python3 mozilla-esr31/python/mozbuild/mozbuild/action/xpidl-process.py
--- mozilla-esr31/python/mozbuild/mozbuild/action/xpidl-process.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/action/xpidl-process.py	2014-09-05 15:26:14.083681065 +0200
@@ -11,7 +11,7 @@ import argparse
 import os
 import sys
 
-from io import BytesIO
+from StringIO import StringIO as BytesIO
 
 from buildconfig import topsrcdir
 from header import print_header
@@ -52,19 +52,23 @@ def process(input_dir, inc_paths, cache_
 
         rule.add_dependencies(idl.deps)
 
-        with FileAvoidWrite(header_path) as fh:
+        fh = FileAvoidWrite(header_path).__enter__()
+        if 1:
             print_header(idl, fh, path)
 
+        fh.__exit__(0, 0, 0)
     # TODO use FileAvoidWrite once it supports binary mode.
     xpt_path = os.path.join(xpt_dir, '%s.xpt' % module)
     xpt_link(xpts.values()).write(xpt_path)
 
     rule.add_targets([xpt_path])
     deps_path = os.path.join(deps_dir, '%s.pp' % module)
-    with FileAvoidWrite(deps_path) as fh:
+    fh = FileAvoidWrite(deps_path).__enter__()
+    if 1:
         mk.dump(fh)
 
 
+    fh.__exit__(0, 0, 0)
 def main(argv):
     parser = argparse.ArgumentParser()
     parser.add_argument('--cache-dir',
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/android_eclipse.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/android_eclipse.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/android_eclipse.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/android_eclipse.py	2014-09-05 15:26:14.083681065 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import itertools
 import os
@@ -16,7 +16,7 @@ from mozpack.files import (FileFinder, P
 from mozpack.manifests import InstallManifest
 import mozpack.path as mozpath
 
-from .common import CommonBackend
+from common import CommonBackend
 from ..frontend.data import (
     AndroidEclipseProjectData,
     SandboxDerived,
@@ -228,7 +228,7 @@ class AndroidEclipseBackend(CommonBacken
         defines['IDE_CLASSPATH_ENTRIES'] = '\n'.join('\t' + cpe for cpe in classpathentries)
         defines['IDE_RECURSIVE_MAKE_TARGETS'] = ' '.join(sorted(data.recursive_make_targets))
         # Like android.library=true
-        defines['IDE_PROJECT_LIBRARY_SETTING'] = 'android.library=true' if data.is_library else ''
+        defines['IDE_PROJECT_LIBRARY_SETTING'] = ('', 'android.library=true')[data.is_library]
         # Like android.library.reference.1=FennecBrandingResources
         defines['IDE_PROJECT_LIBRARY_REFERENCES'] = '\n'.join(
             'android.library.reference.%s=%s' % (i + 1, ref)
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/base.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/base.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/base.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/base.py	2014-09-05 15:26:14.083681065 +0200
@@ -1,8 +1,62 @@
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from abc import (
     ABCMeta,
@@ -13,20 +67,21 @@ import errno
 import os
 import time
 
-from contextlib import contextmanager
+
 
 from mach.mixin.logging import LoggingMixin
 
 import mozpack.path as mozpath
-from ..preprocessor import Preprocessor
-from ..pythonutil import iter_modules_in_path
-from ..util import FileAvoidWrite
-from ..frontend.data import (
+from preprocessor import Preprocessor
+from pythonutil import iter_modules_in_path
+from util import FileAvoidWrite
+from frontend.data import (
     ReaderSummary,
     SandboxDerived,
 )
-from .configenvironment import ConfigEnvironment
+from configenvironment import ConfigEnvironment
 import mozpack.path as mozpath
+from contextdecorator import contextmanager
 
 
 class BackendConsumeSummary(object):
@@ -83,18 +138,18 @@ class BackendConsumeSummary(object):
 
     @property
     def reader_summary(self):
-        return 'Finished reading {:d} moz.build files in {:.2f}s'.format(
+        return 'Finished reading %d moz.build files in %fs' % (
             self.mozbuild_count,
             self.mozbuild_execution_time)
 
     @property
     def emitter_summary(self):
-        return 'Processed into {:d} build config descriptors in {:.2f}s'.format(
+        return 'Processed into %d build config descriptors in %fs' % (
             self.object_count, self.emitter_execution_time)
 
     @property
     def backend_summary(self):
-        return 'Backend executed in {:.2f}s'.format(self.backend_execution_time)
+        return 'Backend executed in %fs' % (self.backend_execution_time)
 
     def backend_detailed_summary(self):
         """Backend summary to be supplied by BuildBackend implementations."""
@@ -102,9 +157,13 @@ class BackendConsumeSummary(object):
 
     @property
     def total_summary(self):
-        efficiency_value = self.cpu_time / self.wall_time if self.wall_time else 100
-        return 'Total wall time: {:.2f}s; CPU time: {:.2f}s; Efficiency: ' \
-            '{:.0%}; Untracked: {:.2f}s'.format(
+        efficiency_value = None
+        if self.wall_time:
+          efficiency_value = self.cpu_time / self.wall_time
+        else:
+          efficiency_value = 100
+        return 'Total wall time: %.2fs; CPU time: %.2fs; Efficiency: ' \
+            '%.0f; Untracked: %.2fs' % (
                 self.wall_time, self.cpu_time, efficiency_value,
                 self.other_time)
 
@@ -179,11 +238,13 @@ class BuildBackend(LoggingMixin):
         base class consumes objects and calls methods (possibly) implemented by
         child classes.
         """
+        #print objs
         cpu_start = time.clock()
         time_start = time.time()
         backend_time = 0.0
 
         for obj in objs:
+            #print self, obj, obj._ack
             self.summary.object_count += 1
             obj_start = time.time()
             self.consume_object(obj)
@@ -219,12 +280,16 @@ class BuildBackend(LoggingMixin):
         # Write out the list of backend files generated, if it changed.
         if self.summary.deleted_count or self.summary.created_count or \
                 not os.path.exists(self._backend_output_list_file):
-            with open(self._backend_output_list_file, 'w') as fh:
+            fh = open(self._backend_output_list_file, 'w')
+            if 1:
                 fh.write('\n'.join(sorted(self._backend_output_files)))
+            fh.__exit__(0, 0, 0)
         elif self.summary.updated_count:
-            with open(self._backend_output_list_file, 'a'):
+            open(self._backend_output_list_file, 'a').__enter__()
+            if 1:
                 os.utime(self._backend_output_list_file, None)
 
+            open(self._backend_output_list_file, 'a').__exit__(0, 0, 0)
         self.summary.cpu_time = time.clock() - cpu_start
         self.summary.wall_time = time.time() - time_start
         self.summary.backend_execution_time = backend_time
@@ -255,8 +320,10 @@ class BuildBackend(LoggingMixin):
 
         Example usage:
 
-            with self._write_file('foo.txt') as fh:
+            fh = self._write_file('foo.txt').__enter__()
+            if 1:
                 fh.write('hello world')
+            fh.close()
         """
 
         if path is not None:
@@ -268,12 +335,13 @@ class BuildBackend(LoggingMixin):
         dirname = mozpath.dirname(fh.name)
         try:
             os.makedirs(dirname)
-        except OSError as error:
+        except OSError, error:
             if error.errno != errno.EEXIST:
                 raise
 
+        #print "preYIELD"
         yield fh
-
+        #print "Ceka na yield?"
         self._backend_output_files.add(mozpath.relpath(fh.name, self.environment.topobjdir))
         existed, updated = fh.close()
         if not existed:
@@ -301,6 +369,9 @@ class BuildBackend(LoggingMixin):
         )
         pp.do_filter('attemptSubstitution')
         pp.setMarker(None)
-        with self._write_file(obj.output_path) as fh:
+        fh = self._write_file(obj.output_path).__enter__()
+        if 1:
             pp.out = fh
             yield pp
+        fh.__exit__(0, 0, 0)
+
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/common.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/common.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/common.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/common.py	2014-09-05 15:26:14.084681070 +0200
@@ -1,18 +1,72 @@
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
 
-import json
+
+import simplejson as json
 import os
 import re
 
 import mozpack.path as mozpath
 
-from .base import BuildBackend
+from base import BuildBackend
 
-from ..frontend.data import (
+from mozbuild.frontend.data import (
     ConfigFileSubstitution,
     ExampleWebIDLInterface,
     HeaderFileSubstitution,
@@ -26,7 +80,7 @@ from ..frontend.data import (
     WebIDLFile,
 )
 
-from ..util import DefaultOnReadDict
+from util import DefaultOnReadDict
 
 
 class XPIDLManager(object):
@@ -188,8 +242,10 @@ class CommonBackend(BuildBackend):
             # to other
             if mozpath.basename(obj.output_path) == 'Makefile':
                 return
-            with self._get_preprocessor(obj) as pp:
+            pp = self._get_preprocessor(obj).__enter__()
+            if 1:
                 pp.do_include(obj.input_path)
+            pp.out.close() #__exit__(0, 0, 0)
             self.backend_input_files.add(obj.input_path)
 
         elif isinstance(obj, HeaderFileSubstitution):
@@ -239,10 +295,13 @@ class CommonBackend(BuildBackend):
 
         # Write out a machine-readable file describing every test.
         path = mozpath.join(self.environment.topobjdir, 'all-tests.json')
-        with self._write_file(path) as fh:
+        fh = file(path, "w")
+        #fh = self._write_file(path)
+        if 1:
             json.dump(self._test_manager.tests_by_path, fh, sort_keys=True,
                 indent=2)
 
+        fh.close()
     def _create_config_header(self, obj):
         '''Creates the given config header. A config header is generated by
         taking the corresponding source file and replacing some #define/#undef
@@ -253,8 +312,11 @@ class CommonBackend(BuildBackend):
             "#undef UNKNOWN_NAME" is turned into "/* #undef UNKNOWN_NAME */"
             Whitespaces are preserved.
         '''
-        with self._write_file(obj.output_path) as fh, \
-             open(obj.input_path, 'rU') as input:
+        fh = self._write_file(obj.output_path).__enter__()
+        input = open(obj.input_path, 'rU') 
+        if 1:
+        #with self._write_file(obj.output_path) as fh, \
+        #     open(obj.input_path, 'rU') as input:
             r = re.compile('^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?', re.U)
             for l in input:
                 m = r.match(l)
@@ -277,5 +339,7 @@ class CommonBackend(BuildBackend):
                                     + l[m.end('name'):]
                         elif cmd == 'undef':
                            l = '/* ' + l[:m.end('name')] + ' */' + l[m.end('name'):]
-
+                #print dir(fh)
                 fh.write(l)
+        fh.close() #__exit__(None, None, None)
+        input.close()
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/configenvironment.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/configenvironment.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/configenvironment.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/configenvironment.py	2014-09-05 15:26:14.084681070 +0200
@@ -4,21 +4,22 @@
 
 import sys
 
-from collections import Iterable
+from rhrebase import isIterable
+#from collections import Iterable
 from types import StringTypes
 
 import mozpack.path as mozpath
 
-from ..util import (
+from util import (
     ReadOnlyDict,
     shell_quote,
 )
 
 
-if sys.version_info.major == 2:
-    text_type = unicode
-else:
-    text_type = str
+#if sys.version_info.major == 2:
+text_type = str
+#else:
+text_type = str
 
 
 class BuildConfig(object):
@@ -36,9 +37,10 @@ class BuildConfig(object):
     def from_config_status(path):
         """Create an instance from a config.status file."""
 
-        with open(path, 'rt') as fh:
+        fh = open(path, 'rt')
+        if 1:
             source = fh.read()
-            code = compile(source, path, 'exec', dont_inherit=1)
+            code = compile(source, path, 'exec', 0, 1)
             g = {
                 '__builtins__': __builtins__,
                 '__file__': path,
@@ -51,7 +53,8 @@ class BuildConfig(object):
             for name in l['__all__']:
                 setattr(config, name, l[name])
 
-            return config
+        fh.close()
+        return config
 
 
 class ConfigEnvironment(object):
@@ -115,7 +118,7 @@ class ConfigEnvironment(object):
         def serialize(obj):
             if isinstance(obj, StringTypes):
                 return obj
-            if isinstance(obj, Iterable):
+            if isIterable(obj):
                 return ' '.join(obj)
             raise Exception('Unhandled type %s', type(obj))
         self.substs['ALLSUBSTS'] = '\n'.join(sorted(['%s = %s' % (name,
@@ -143,7 +146,7 @@ class ConfigEnvironment(object):
 
         for k, v in self.substs.items():
             if not isinstance(v, StringTypes):
-                if isinstance(v, Iterable):
+                if isIterable(v):
                     type(v)(decode(i) for i in v)
             elif not isinstance(v, text_type):
                 v = decode(v)
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/cpp_eclipse.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/cpp_eclipse.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/cpp_eclipse.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/cpp_eclipse.py	2014-09-05 15:26:14.084681070 +0200
@@ -7,7 +7,7 @@ import errno
 import types
 import os
 import xml.etree.ElementTree as ET
-from .common import CommonBackend
+from common import CommonBackend
 
 from ..frontend.data import (
     Defines,
@@ -67,40 +67,52 @@ class CppEclipseBackend(CommonBackend):
         for dir_name in [self._project_dir, settings_dir, launch_dir, workspace_settings_dir, workspace_language_dir]:
             try:
                 os.makedirs(dir_name)
-            except OSError as e:
+            except OSError, e:
                 if e.errno != errno.EEXIST:
                     raise
 
         project_path = os.path.join(self._project_dir, '.project')
-        with open(project_path, 'wb') as fh:
+        fh = open(project_path, 'wb')
+        if 1:
             self._write_project(fh)
 
+        fh.close()
         cproject_path = os.path.join(self._project_dir, '.cproject')
-        with open(cproject_path, 'wb') as fh:
+        fh = open(cproject_path, 'wb')
+        if 1:
             self._write_cproject(fh)
 
+        fh.close()
         language_path = os.path.join(settings_dir, 'language.settings.xml')
-        with open(language_path, 'wb') as fh:
+        fh = open(language_path, 'wb')
+        if 1:
             self._write_language_settings(fh)
 
+        fh.close()
         workspace_language_path = os.path.join(workspace_language_dir, 'language.settings.xml')
-        with open(workspace_language_path, 'wb') as fh:
+        fh = open(workspace_language_path, 'wb')
+        if 1:
             workspace_lang_settings = WORKSPACE_LANGUAGE_SETTINGS_TEMPLATE
             workspace_lang_settings = workspace_lang_settings.replace("@COMPILER_FLAGS@", self._cxx + " " + self._cppflags);
             fh.write(workspace_lang_settings)
 
+        fh.close()
         self._write_launch_files(launch_dir)
 
         # This will show up as an 'unmanged' formatter. This can be named by generating
         # another file.
         formatter_prefs_path = os.path.join(settings_dir, 'org.eclipse.cdt.core.prefs')
-        with open(formatter_prefs_path, 'wb') as fh:
+        fh = open(formatter_prefs_path, 'wb')
+        if 1:
             fh.write(FORMATTER_SETTINGS);
 
+        fh.close()
         editor_prefs_path = os.path.join(workspace_settings_dir, "org.eclipse.ui.editors.prefs");
-        with open(editor_prefs_path, 'wb') as fh:
+        fh = open(editor_prefs_path, 'wb')
+        if 1:
             fh.write(EDITOR_SETTINGS);
 
+        fh.close()
     def _define_entry(self, name, value):
         define = ET.Element('entry')
         define.set('kind', 'macro')
@@ -134,15 +146,18 @@ class CppEclipseBackend(CommonBackend):
 
         if self.environment.substs['MOZ_WIDGET_TOOLKIT'] != 'gonk':
             main_gecko_launch = os.path.join(launch_dir, 'gecko.launch')
-            with open(main_gecko_launch, 'wb') as fh:
+            fh = open(main_gecko_launch, 'wb')
+            if 1:
                 launch = GECKO_LAUNCH_CONFIG_TEMPLATE
                 launch = launch.replace('@LAUNCH_PROGRAM@', exe_path)
                 launch = launch.replace('@LAUNCH_ARGS@', '-P -no-remote')
                 fh.write(launch)
 
+            fh.close()
         if self.environment.substs['MOZ_WIDGET_TOOLKIT'] == 'gonk':
             b2g_flash = os.path.join(launch_dir, 'b2g-flash.launch')
-            with open(b2g_flash, 'wb') as fh:
+            fh = open(b2g_flash, 'wb')
+            if 1:
                 # We assume that the srcdir is inside the b2g tree.
                 # If that's not the case the user can always adjust the path
                 # from the eclipse IDE.
@@ -152,6 +167,7 @@ class CppEclipseBackend(CommonBackend):
                 launch = launch.replace('@OBJDIR@', self.environment.topobjdir)
                 fh.write(launch)
 
+            fh.close()
         #TODO Add more launch configs (and delegate calls to mach)
 
     def _write_project(self, fh):
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/recursivemake.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/recursivemake.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/recursivemake.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/recursivemake.py	2014-09-05 15:26:14.084681070 +0200
@@ -1,16 +1,106 @@
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+class ZipExhausted(Exception):
+    pass
+
+def next(iter):
+  return iter.next()
+
+def izip_longest(*args, **kwds):
+    # izip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
+    fillvalue = kwds.get('fillvalue')
+    counter = [len(args) - 1]
+    def sentinel():
+        if not counter[0]:
+            raise ZipExhausted
+        counter[0] -= 1
+        yield fillvalue
+    fillers = repeat(fillvalue)
+    iterators = [chain(it, sentinel(), fillers) for it in args]
+    try:
+        while iterators:
+            yield tuple(map(next, iterators))
+    except ZipExhausted:
+        pass
+
+def repeat(object, times=None):
+    # repeat(10, 3) --> 10 10 10
+    if times is None:
+        while True:
+            yield object
+    else:
+        for i in xrange(times):
+            yield object
+
+def chain(*iterables):
+    # chain('ABC', 'DEF') --> A B C D E F
+    for it in iterables:
+        for element in it:
+            yield element
 
 import itertools
-import json
+import simplejson as json
 import logging
 import os
 import types
 
-from collections import namedtuple
+from namedtuple import namedtuple
 
 import mozwebidlcodegen
 
@@ -21,8 +111,8 @@ from mozpack.manifests import (
 )
 import mozpack.path as mozpath
 
-from .common import CommonBackend
-from ..frontend.data import (
+from common import CommonBackend
+from mozbuild.frontend.data import (
     AndroidEclipseProjectData,
     ConfigFileSubstitution,
     Defines,
@@ -47,11 +137,11 @@ from ..frontend.data import (
     VariablePassthru,
     XPIDLFile,
 )
-from ..util import (
+from util import (
     ensureParentDir,
     FileAvoidWrite,
 )
-from ..makeutil import Makefile
+from makeutil import Makefile
 
 class BackendMakeFile(object):
     """Represents a generated backend.mk file.
@@ -190,8 +280,7 @@ class RecursiveMakeTraversal(object):
         where current is the directory being traversed, and subdirs the
         SubDirectories instance corresponding to it.
         The filter function returns a tuple (filtered_current, filtered_parallel,
-        filtered_dirs) where filtered_current is either current or None if
-        the current directory is to be skipped, and filtered_parallel and
+        filtered_dirs) where filtered_current is either current or None if the current directory is to be skipped, and filtered_parallel and
         filtered_dirs are lists of parallel directories and sequential
         directories, which can be rearranged from whatever is given in the
         SubDirectories members.
@@ -272,9 +361,9 @@ class RecursiveMakeBackend(CommonBackend
         self._ipdl_sources = set()
 
         def detailed(summary):
-            s = '{:d} total backend files; ' \
-                '{:d} created; {:d} updated; {:d} unchanged; ' \
-                '{:d} deleted; {:d} -> {:d} Makefile'.format(
+            s = '%d total backend files; ' \
+                '%d created; %d updated; %d unchanged; ' \
+                '%d deleted; %d -> %d Makefile' % (
                 summary.created_count + summary.updated_count +
                 summary.unchanged_count,
                 summary.created_count,
@@ -297,6 +386,18 @@ class RecursiveMakeBackend(CommonBackend
         self.backend_input_files.add(mozpath.join(self.environment.topobjdir,
             'config', 'autoconf.mk'))
 
+        self._install_manifests = {}
+        for k in [
+                'dist_bin',
+                'dist_idl',
+                'dist_include',
+                'dist_public',
+                'dist_private',
+                'dist_sdk',
+                'tests',
+                'xpidl']:
+          self._install_manifests[k] = InstallManifest()
+        ''' 
         self._install_manifests = {
             k: InstallManifest() for k in [
                 'dist_bin',
@@ -308,7 +409,7 @@ class RecursiveMakeBackend(CommonBackend
                 'tests',
                 'xpidl',
             ]}
-
+        '''
         self._traversal = RecursiveMakeTraversal()
         self._may_skip = {
             'export': set(),
@@ -330,7 +431,7 @@ class RecursiveMakeBackend(CommonBackend
 
         if not isinstance(obj, SandboxDerived):
             return
-
+        #print "consume obj", obj
         if obj.objdir not in self._backend_files:
             self._backend_files[obj.objdir] = \
                 BackendMakeFile(obj.srcdir, obj.objdir, obj.config)
@@ -348,8 +449,10 @@ class RecursiveMakeBackend(CommonBackend
             self._process_test_manifest(obj, backend_file)
 
         # If CommonBackend acknowledged the object, we're done with it.
+        #print "pre ack", obj
         if obj._ack:
             return
+        #print "post ack", obj
 
         if isinstance(obj, DirectoryTraversal):
             self._process_directory_traversal(obj, backend_file)
@@ -466,7 +569,9 @@ class RecursiveMakeBackend(CommonBackend
             self._process_library_definition(obj, backend_file)
 
         else:
+            #print "wasn't ack", obj
             return
+        #print "acking"
         obj.ack()
 
     def _fill_root_mk(self):
@@ -479,7 +584,7 @@ class RecursiveMakeBackend(CommonBackend
             for tier, skip in self._may_skip.items():
                 self.log(logging.DEBUG, 'fill_root_mk', {
                     'number': len(skip), 'tier': tier
-                    }, 'Ignoring {number} directories during {tier}')
+                    }, 'Ignoring %(number)d directories during %(tier)s')
 
         # Traverse directories in parallel, and skip static dirs
         def parallel_filter(current, subdirs):
@@ -589,14 +694,16 @@ class RecursiveMakeBackend(CommonBackend
 
         root_mk.add_statement('$(call include_deps,root-deps.mk)')
 
-        with self._write_file(
-                mozpath.join(self.environment.topobjdir, 'root.mk')) as root:
+        root = self._write_file( mozpath.join(self.environment.topobjdir, 'root.mk')).__enter__()
+        if 1:
             root_mk.dump(root, removal_guard=False)
 
-        with self._write_file(
-                mozpath.join(self.environment.topobjdir, 'root-deps.mk')) as root_deps:
+        root.__exit__(0, 0, 0)
+        root_deps = self._write_file( mozpath.join(self.environment.topobjdir, 'root-deps.mk')).__enter__()
+        if 1:
             root_deps_mk.dump(root_deps, removal_guard=False)
 
+        root_deps.__exit__(0, 0, 0)
     def _add_unified_build_rules(self, makefile, files, output_directory,
                                  unified_prefix='Unified',
                                  unified_suffix='cpp',
@@ -631,14 +738,17 @@ class RecursiveMakeBackend(CommonBackend
             def grouper(n, iterable):
                 "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
                 args = [iter(iterable)] * n
-                return itertools.izip_longest(fillvalue=dummy_fill_value, *args)
+                #return itertools.izip_longest(fillvalue=dummy_fill_value, *args)
+                #return itertools.izip(fillvalue=dummy_fill_value, *args)
+                return izip_longest(fillvalue=dummy_fill_value, *args)
 
             for i, unified_group in enumerate(grouper(files_per_unified_file,
                                                       files)):
                 just_the_filenames = list(filter_out_dummy(unified_group))
                 yield '%s%d.%s' % (unified_prefix, i, unified_suffix), just_the_filenames
 
-        all_sources = ' '.join(source for source, _ in unified_files())
+        my_unified_files = [f for f in unified_files()]
+        all_sources = ' '.join(source for source, _ in my_unified_files)
         makefile.add_statement('%s := %s' % (unified_files_makefile_variable,
                                                all_sources))
 
@@ -651,7 +761,8 @@ class RecursiveMakeBackend(CommonBackend
             # blown away and we need to regenerate them.  The rule doesn't correctly
             # handle source files being added/removed/renamed.  Therefore, we
             # generate them here also to make sure everything's up-to-date.
-            with self._write_file(mozpath.join(output_directory, unified_file)) as f:
+            f = self._write_file(mozpath.join(output_directory, unified_file)).__enter__()
+            if 1:
                 f.write('#define MOZ_UNIFIED_BUILD\n')
                 includeTemplate = '#include "%(cppfile)s"'
                 if poison_windows_h:
@@ -680,6 +791,7 @@ class RecursiveMakeBackend(CommonBackend
                 f.write('\n'.join(includeTemplate % { "cppfile": s } for
                                   s in source_filenames))
 
+            f.close() #f.__exit__(0, 0, 0)
         if include_curdir_build_rules:
             makefile.add_statement('\n'
                 '# Make sometimes gets confused between "foo" and "$(CURDIR)/foo".\n'
@@ -695,7 +807,8 @@ class RecursiveMakeBackend(CommonBackend
 
         for objdir, backend_file in sorted(self._backend_files.items()):
             srcdir = backend_file.srcdir
-            with self._write_file(fh=backend_file) as bf:
+            bf = self._write_file(fh=backend_file).__enter__()
+            if 1:
                 makefile_in = mozpath.join(srcdir, 'Makefile.in')
                 makefile = mozpath.join(objdir, 'Makefile')
 
@@ -724,6 +837,7 @@ class RecursiveMakeBackend(CommonBackend
                 obj.config = bf.environment
                 self._create_makefile(obj, stub=stub)
 
+            bf.close()
         # Write out a master list of all IPDL source files.
         ipdl_dir = mozpath.join(self.environment.topobjdir, 'ipc', 'ipdl')
         mk = mozmakeutil.Makefile()
@@ -751,15 +865,27 @@ class RecursiveMakeBackend(CommonBackend
         mk.add_statement('IPDLDIRS := %s' % ' '.join(sorted(set(mozpath.dirname(p)
             for p in self._ipdl_sources))))
 
-        with self._write_file(mozpath.join(ipdl_dir, 'ipdlsrcs.mk')) as ipdls:
+        ipdls = self._write_file(mozpath.join(ipdl_dir, 'ipdlsrcs.mk')).__enter__()
+        #ipdls = file(mozpath.join(ipdl_dir, 'ipdlsrcs.mk'), "w")
+        if 1:
             mk.dump(ipdls, removal_guard=False)
 
+        ipdls.__exit__(0,0,0)
         # These contain autogenerated sources that the build config doesn't
         # yet know about.
         # TODO Emit GENERATED_SOURCES so these special cases are dealt with
         # the proper way.
-        self._may_skip['compile'] -= {'ipc/ipdl'}
-        self._may_skip['compile'] -= {'dom/bindings', 'dom/bindings/test'}
+        #print self._may_skip['compile']
+        if 'ipc/ipdl' in self._may_skip['compile']:
+          self._may_skip['compile'].remove('ipc/ipdl')
+        #print self._may_skip['compile']
+        #self._may_skip['compile'] -= {'ipc/ipdl'}
+        if 'dom/bindings' in self._may_skip['compile']:
+          self._may_skip['compile'].remove('dom/bindings')
+        if 'dom/bindings/test' in self._may_skip['compile']:
+          self._may_skip['compile'].remove('dom/bindings/test')
+        #print self._may_skip['compile']
+        #self._may_skip['compile'] -= {'dom/bindings', 'dom/bindings/test'}
 
         self._fill_root_mk()
 
@@ -770,13 +896,16 @@ class RecursiveMakeBackend(CommonBackend
         # We need to use $(DEPTH) so the target here matches what's in
         # rules.mk. If they are different, the dependencies don't get pulled in
         # properly.
-        with self._write_file('%s.pp' % self._backend_output_list_file) as backend_deps:
+        backend_deps = self._write_file('%s.pp' % self._backend_output_list_file).__enter__()
+        if 1:
             backend_deps.write('$(DEPTH)/backend.%s: %s\n' %
                 (self.__class__.__name__, ' '.join(inputs)))
             for path in inputs:
                 backend_deps.write('%s:\n' % path)
 
-        with open(self._backend_output_list_file, 'a'):
+        backend_deps.__exit__(0, 0, 0)
+        open(self._backend_output_list_file, 'a')
+        if 1:
             pass
         os.utime(self._backend_output_list_file, None)
 
@@ -1047,8 +1176,7 @@ class RecursiveMakeBackend(CommonBackend
             obj.manifest_relpath))
 
         # Don't allow files to be defined multiple times unless it is allowed.
-        # We currently allow duplicates for non-test files or test files if
-        # the manifest is listed as a duplicate.
+        # We currently allow duplicates for non-test files or test files if # the manifest is listed as a duplicate.
         for source, (dest, is_test) in obj.installs.items():
             try:
                 self._install_manifests['tests'].add_symlink(source, dest)
@@ -1154,22 +1282,28 @@ class RecursiveMakeBackend(CommonBackend
         # manifests are deleted.
         purger = FilePurger()
 
+        #print(manifests.items())
         for k, manifest in manifests.items():
             purger.add(k)
+            fh = self._write_file(mozpath.join(man_dir, k)).__enter__()
+            if 1:
+               manifest.write(fileobj=fh)
+            fh.close()
 
-            with self._write_file(mozpath.join(man_dir, k)) as fh:
-                manifest.write(fileobj=fh)
+            #with self._write_file(mozpath.join(man_dir, k)) as fh:
+            #    manifest.write(fileobj=fh)
 
         purger.purge(man_dir)
 
     def _write_master_test_manifest(self, path, manifests):
-        with self._write_file(path) as master:
+        master = self._write_file(path).__enter__()
+        if 1:
             master.write(
                 '; THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY BY HAND.\n\n')
 
             for manifest in sorted(manifests):
                 master.write('[include:%s]\n' % manifest)
-
+        master.__exit__(0, 0, 0)
     class Substitution(object):
         """BaseConfigSubstitution-like class for use with _create_makefile."""
         __slots__ = (
@@ -1188,24 +1322,26 @@ class RecursiveMakeBackend(CommonBackend
         When the stub argument is True, no source file is used, and a stub
         makefile with the default header and footer only is created.
         '''
-        with self._get_preprocessor(obj) as pp:
+        pp = self._get_preprocessor(obj).__enter__()
+        if 1:
             if extra:
                 pp.context.update(extra)
             if not pp.context.get('autoconfmk', ''):
                 pp.context['autoconfmk'] = 'autoconf.mk'
-            pp.handleLine(b'# THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY BY HAND.\n');
-            pp.handleLine(b'DEPTH := @DEPTH@\n')
-            pp.handleLine(b'topsrcdir := @top_srcdir@\n')
-            pp.handleLine(b'srcdir := @srcdir@\n')
-            pp.handleLine(b'VPATH := @srcdir@\n')
-            pp.handleLine(b'relativesrcdir := @relativesrcdir@\n')
-            pp.handleLine(b'include $(DEPTH)/config/@autoconfmk@\n')
+            pp.handleLine('# THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY BY HAND.\n');
+            pp.handleLine('DEPTH := @DEPTH@\n')
+            pp.handleLine('topsrcdir := @top_srcdir@\n')
+            pp.handleLine('srcdir := @srcdir@\n')
+            pp.handleLine('VPATH := @srcdir@\n')
+            pp.handleLine('relativesrcdir := @relativesrcdir@\n')
+            pp.handleLine('include $(DEPTH)/config/@autoconfmk@\n')
             if not stub:
                 pp.do_include(obj.input_path)
             # Empty line to avoid failures when last line in Makefile.in ends
             # with a backslash.
-            pp.handleLine(b'\n')
-            pp.handleLine(b'include $(topsrcdir)/config/recurse.mk\n')
+            pp.handleLine('\n')
+            pp.handleLine('include $(topsrcdir)/config/recurse.mk\n')
+        pp.out.close()
         if not stub:
             # Adding the Makefile.in here has the desired side-effect
             # that if the Makefile.in disappears, this will force
@@ -1240,9 +1376,11 @@ class RecursiveMakeBackend(CommonBackend
         )
 
         file_lists = mozpath.join(bindings_dir, 'file-lists.json')
-        with self._write_file(file_lists) as fh:
+        fh = self._write_file(file_lists).__enter__()
+        if 1:
             json.dump(o, fh, sort_keys=True, indent=2)
 
+        fh.close() #__exit__(0, 0, 0)
         manager = mozwebidlcodegen.create_build_system_manager(
             self.environment.topsrcdir,
             self.environment.topobjdir,
@@ -1297,5 +1435,8 @@ class RecursiveMakeBackend(CommonBackend
             poison_windows_h=True)
 
         webidls_mk = mozpath.join(bindings_dir, 'webidlsrcs.mk')
-        with self._write_file(webidls_mk) as fh:
+        fh = self._write_file(webidls_mk).__enter__()
+        if 1:
             mk.dump(fh, removal_guard=False)
+        fh.close() #exit__(0, 0, 0)
+
diff -up mozilla-esr31/python/mozbuild/mozbuild/backend/visualstudio.py.python3 mozilla-esr31/python/mozbuild/mozbuild/backend/visualstudio.py
--- mozilla-esr31/python/mozbuild/mozbuild/backend/visualstudio.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/backend/visualstudio.py	2014-09-05 15:26:14.085681075 +0200
@@ -5,7 +5,7 @@
 # This file contains a build backend for generating Visual Studio project
 # files.
 
-from __future__ import unicode_literals
+
 
 import errno
 import os
@@ -17,7 +17,7 @@ from xml.dom import getDOMImplementation
 
 from mozpack.files import FileFinder
 
-from .common import CommonBackend
+from common import CommonBackend
 from ..frontend.data import (
     Defines,
     LibraryDefinition,
@@ -122,7 +122,7 @@ class VisualStudioBackend(CommonBackend)
         out_dir = self._out_dir
         try:
             os.makedirs(out_dir)
-        except OSError as e:
+        except OSError, e:
             if e.errno != errno.EEXIST:
                 raise
 
@@ -218,26 +218,34 @@ class VisualStudioBackend(CommonBackend)
 
         # Write out a shared property file with common variables.
         props_path = os.path.join(out_dir, 'mozilla.props')
-        with open(props_path, 'wb') as fh:
+        fh = open(props_path, 'wb')
+        if 1:
             self._write_props(fh)
 
+        fh.close()
         # Generate some wrapper scripts that allow us to invoke mach inside
         # a MozillaBuild-like environment. We currently only use the batch
         # script. We'd like to use the PowerShell script. However, it seems
         # to buffer output from within Visual Studio (surely this is
         # configurable) and the default execution policy of PowerShell doesn't
         # allow custom scripts to be executed.
-        with open(os.path.join(out_dir, 'mach.bat'), 'wb') as fh:
+        fh = open(os.path.join(out_dir, 'mach.bat'), 'wb')
+        if 1:
             self._write_mach_batch(fh)
 
-        with open(os.path.join(out_dir, 'mach.ps1'), 'wb') as fh:
+        fh.close()
+        fh = open(os.path.join(out_dir, 'mach.ps1'), 'wb')
+        if 1:
             self._write_mach_powershell(fh)
 
+        fh.close()
         # Write out a solution file to tie it all together.
         solution_path = os.path.join(out_dir, 'mozilla.sln')
-        with open(solution_path, 'wb') as fh:
+        fh = open(solution_path, 'wb')
+        if 1:
             self._write_solution(fh, projects)
 
+        fh.close()
     def _write_solution(self, fh, projects):
         version = visual_studio_product_to_internal_version(self._version, True)
         # This is a Visual C++ Project type.
@@ -425,16 +433,20 @@ class VisualStudioBackend(CommonBackend)
 
     def _write_vs_project(self, out_dir, basename, name, **kwargs):
         root = '%s.vcxproj' % basename
-        with open(os.path.join(out_dir, root), 'wb') as fh:
+        fh = open(os.path.join(out_dir, root), 'wb')
+        if 1:
             project_id, name = VisualStudioBackend.write_vs_project(fh,
                 self._version, name, **kwargs)
 
-        with open(os.path.join(out_dir, '%s.user' % root), 'w') as fh:
+        fh.close()
+        fh = open(os.path.join(out_dir, '%s.user' % root), 'w')
+        if 1:
             fh.write('<?xml version="1.0" encoding="utf-8"?>\r\n')
             fh.write('<Project ToolsVersion="4.0" xmlns="%s">\r\n' %
                 MSBUILD_NAMESPACE)
             fh.write('</Project>\r\n')
 
+        fh.close()
         return project_id
 
     @staticmethod
diff -up mozilla-esr31/python/mozbuild/mozbuild/base.py.python3 mozilla-esr31/python/mozbuild/mozbuild/base.py
--- mozilla-esr31/python/mozbuild/mozbuild/base.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/base.py	2014-09-05 15:26:14.085681075 +0200
@@ -2,12 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
-import json
+import simplejson as json
 import logging
 import mozpack.path
-import multiprocessing
+#import multiprocessing
 import os
 import subprocess
 import sys
@@ -18,14 +22,14 @@ from mach.mixin.process import ProcessEx
 
 from mozfile.mozfile import rmtree
 
-from .backend.configenvironment import ConfigEnvironment
-from .controller.clobber import Clobberer
-from .mozconfig import (
+from backend.configenvironment import ConfigEnvironment
+from controller.clobber import Clobberer
+from mozconfig import (
     MozconfigFindException,
     MozconfigLoadException,
     MozconfigLoader,
 )
-from .virtualenv import VirtualenvManager
+from virtualenv import VirtualenvManager
 
 
 def ancestors(path):
@@ -327,7 +331,11 @@ class MozbuildObject(ProcessExecutionMix
 
         leaf = None
 
-        leaf = (substs['MOZ_APP_NAME'] if what == 'app' else what) + substs['BIN_SUFFIX']
+        leaf = None
+        if what == 'app':
+          leaf = (substs['MOZ_APP_NAME'])
+        else:
+          leaf = (what) + substs['BIN_SUFFIX']
         path = os.path.join(stem, leaf)
 
         if validate_exists and not os.path.exists(path):
@@ -421,7 +429,7 @@ class MozbuildObject(ProcessExecutionMix
             if num_jobs > 0:
                 args.append('-j%d' % num_jobs)
             else:
-                args.append('-j%d' % multiprocessing.cpu_count())
+                args.append('-j%d' % 1)#multiprocessing.cpu_count())
         elif num_jobs > 0:
             args.append('MOZ_PARALLEL_BUILD=%d' % num_jobs)
 
@@ -449,7 +457,7 @@ class MozbuildObject(ProcessExecutionMix
             fn = self._run_command_in_srcdir
 
         append_env = dict(append_env or ())
-        append_env[b'MACH'] = '1'
+        append_env['MACH'] = '1'
 
         params = {
             'args': args,
@@ -566,11 +574,11 @@ class MachCommandBase(MozbuildObject):
         try:
             self.mozconfig
 
-        except MozconfigFindException as e:
+        except MozconfigFindException, e:
             print(e.message)
             sys.exit(1)
 
-        except MozconfigLoadException as e:
+        except MozconfigLoadException, e:
             print('Error loading mozconfig: ' + e.path)
             print('')
             print(e.message)
@@ -625,7 +633,11 @@ class PathArgument(object):
         self.arg = arg
         self.topsrcdir = topsrcdir
         self.topobjdir = topobjdir
-        self.cwd = os.getcwd() if cwd is None else cwd
+        self.cwd = None
+        if cwd is None:
+          self.cwd = os.getcwd()
+        else:
+          self.cwd = cwd
 
     def relpath(self):
         """Return a path relative to the topsrcdir or topobjdir.
diff -up mozilla-esr31/python/mozbuild/mozbuild/compilation/warnings.py.python3 mozilla-esr31/python/mozbuild/mozbuild/compilation/warnings.py
--- mozilla-esr31/python/mozbuild/mozbuild/compilation/warnings.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/compilation/warnings.py	2014-09-05 15:26:14.085681075 +0200
@@ -4,7 +4,7 @@
 
 # This modules provides functionality for dealing with compiler warnings.
 
-from __future__ import unicode_literals
+
 
 import errno
 import json
@@ -261,21 +261,25 @@ class WarningsDatabase(object):
 
     def load_from_file(self, filename):
         """Load the database from a file."""
-        with open(filename, 'rb') as fh:
+        fh = open(filename, 'rb')
+        if 1:
             self.deserialize(fh)
 
+        fh.close()
     def save_to_file(self, filename):
         """Save the database to a file."""
         try:
             # Ensure the directory exists
             os.makedirs(os.path.dirname(filename))
-        except OSError as e:
+        except OSError, e:
             if e.errno != errno.EEXIST:
                 raise
-        with open(filename, 'wb') as fh:
+        fh = open(filename, 'wb')
+        if 1:
             self.serialize(fh)
 
 
+        fh.close()
 class WarningsCollector(object):
     """Collects warnings from text data.
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/config_status.py.python3 mozilla-esr31/python/mozbuild/mozbuild/config_status.py
--- mozilla-esr31/python/mozbuild/mozbuild/config_status.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/config_status.py	2014-09-05 15:26:14.085681075 +0200
@@ -6,7 +6,9 @@
 # drop-in replacement for autoconf 2.13's config.status, with features
 # borrowed from autoconf > 2.5, and additional features.
 
-from __future__ import print_function
+import sys
+def print24(msg, file=sys.stdout, end="\n"):
+  file.write(msg + end)
 
 import logging
 import os
@@ -140,15 +142,20 @@ def config_status(topobjdir='.', topsrcd
         os.chdir(topobjdir)
         os.execlp('sh', 'sh', '-c', ' '.join([os.path.join(topsrcdir, 'configure'), env.substs['ac_configure_args'], '--no-create', '--no-recursion']))
 
-    log_level = logging.DEBUG if options.verbose else logging.INFO
+    log_level = None
+    if options.verbose:
+      log_level = logging.DEBUG
+    else:
+      log_level = logging.INFO
     log_manager.add_terminal_logging(level=log_level)
     log_manager.enable_unstructured()
 
-    print('Reticulating splines...', file=sys.stderr)
+    print24('Reticulating splines...', file=sys.stderr)
+    #print definitions
     summary = the_backend.consume(definitions)
 
     for line in summary.summaries():
-        print(line, file=sys.stderr)
+        print24(line, file=sys.stderr)
 
     if options.diff:
         for path, diff in sorted(summary.file_diffs.items()):
diff -up mozilla-esr31/python/mozbuild/mozbuild/controller/building.py.python3 mozilla-esr31/python/mozbuild/mozbuild/controller/building.py
--- mozilla-esr31/python/mozbuild/mozbuild/controller/building.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/controller/building.py	2014-09-05 15:26:14.085681075 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import getpass
 import json
@@ -258,9 +258,11 @@ class BuildMonitor(MozbuildObject):
             if not usage:
                 return
 
-            with open(self._get_state_filename('build_resources.json'), 'w') as fh:
+            fh = open(self._get_state_filename('build_resources.json'), 'w')
+            if 1:
                 json.dump(usage, fh, indent=2)
-        except Exception as e:
+            fh.close()
+        except Exception, e:
             self.log(logging.WARNING, 'build_resources_error',
                 {'msg': str(e)},
                 'Exception when writing resource usage file: {msg}')
@@ -451,7 +453,7 @@ class BuildDriver(MozbuildObject):
 
         env = {}
         if not remove:
-            env[b'NO_REMOVE'] = b'1'
+            env[b'NO_REMOVE'] = '1'
 
         self._run_make(target='install-tests', append_env=env, pass_thru=True,
             print_directory=False)
diff -up mozilla-esr31/python/mozbuild/mozbuild/controller/clobber.py.python3 mozilla-esr31/python/mozbuild/mozbuild/controller/clobber.py
--- mozilla-esr31/python/mozbuild/mozbuild/controller/clobber.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/controller/clobber.py	2014-09-05 15:26:14.085681075 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function
+def print24(msg, file=None, end=""):
+  if file:
+    file.write(msg + end)
+  else:
+    sys.stdout.write(msg + end)
 
 r'''This module contains code for managing clobbering of the tree.'''
 
@@ -77,10 +81,12 @@ class Clobberer(object):
         This returns a list of lines describing why the clobber was required.
         Each line is stripped of leading and trailing whitespace.
         """
-        with open(self.src_clobber, 'rt') as fh:
+        fh = open(self.src_clobber, 'rt')
+        if 1:
             lines = [l.strip() for l in fh.readlines()]
             return [l for l in lines if l and not l.startswith('#')]
 
+        fh.close()
     def ensure_objdir_state(self):
         """Ensure the CLOBBER file in the objdir exists.
 
@@ -92,7 +98,8 @@ class Clobberer(object):
 
         if not os.path.exists(self.obj_clobber):
             # Simply touch the file.
-            with open(self.obj_clobber, 'a'):
+            open(self.obj_clobber, 'a')
+            if 1:
                 pass
 
     def maybe_do_clobber(self, cwd, allow_auto=False, fh=sys.stderr):
@@ -113,7 +120,7 @@ class Clobberer(object):
         cwd = os.path.normpath(cwd)
 
         if not self.clobber_needed():
-            print('Clobber not needed.', file=fh)
+            print24('Clobber not needed.', file=fh)
             self.ensure_objdir_state()
             return False, False, None
 
@@ -134,7 +141,7 @@ class Clobberer(object):
             return True, False, self._message(
                 'Cannot clobber while the shell is inside the object directory.')
 
-        print('Automatically clobbering %s' % self.topobjdir, file=fh)
+        print24('Automatically clobbering %s' % self.topobjdir, file=fh)
         try:
             if cwd == self.topobjdir:
                 for entry in os.listdir(self.topobjdir):
@@ -149,9 +156,9 @@ class Clobberer(object):
                 rmtree(self.topobjdir)
 
             self.ensure_objdir_state()
-            print('Successfully completed auto clobber.', file=fh)
+            print24('Successfully completed auto clobber.', file=fh)
             return True, True, None
-        except (IOError) as error:
+        except (IOError), error:
             return True, False, self._message(
                 'Error when automatically clobbering: ' + str(error))
 
@@ -164,7 +171,7 @@ class Clobberer(object):
 
 def main(args, env, cwd, fh=sys.stderr):
     if len(args) != 2:
-        print('Usage: clobber.py topsrcdir topobjdir', file=fh)
+        print24('Usage: clobber.py topsrcdir topobjdir', file=fh)
         return 1
 
     topsrcdir, topobjdir = args
@@ -175,16 +182,20 @@ def main(args, env, cwd, fh=sys.stderr):
     if not os.path.isabs(topobjdir):
         topobjdir = os.path.abspath(topobjdir)
 
-    auto = True if env.get('AUTOCLOBBER', False) else False
+    auto = None
+    if env.get('AUTOCLOBBER', False):
+      auto = True
+    else:
+      auto = False
     clobber = Clobberer(topsrcdir, topobjdir)
     required, performed, message = clobber.maybe_do_clobber(cwd, auto, fh)
 
     if not required or performed:
         if performed and env.get('TINDERBOX_OUTPUT'):
-            print('TinderboxPrint: auto clobber', file=fh)
+            print24('TinderboxPrint: auto clobber', file=fh)
         return 0
 
-    print(message, file=fh)
+    print24(message, file=fh)
     return 1
 
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/data.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/data.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/data.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/data.py	2014-09-05 15:26:14.086681080 +0200
@@ -15,17 +15,18 @@ contains the code for converting execute
 structures.
 """
 
-from __future__ import unicode_literals
+
 
 import os
 
-from collections import OrderedDict
+from ordereddict import OrderedDict
+
 from mozbuild.util import (
     shell_quote,
     StrictOrderingOnAppendList,
 )
 import mozpack.path as mozpath
-from .sandbox_symbols import FinalTargetValue
+from sandbox_symbols import FinalTargetValue
 
 
 class TreeMetadata(object):
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/emitter.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/emitter.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/emitter.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/emitter.py	2014-09-05 15:26:14.086681080 +0200
@@ -1,10 +1,64 @@
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
 
-import json
+
+import simplejson as json
 import logging
 import os
 import traceback
@@ -16,7 +70,7 @@ from mach.mixin.logging import LoggingMi
 import mozpack.path as mozpath
 import manifestparser
 
-from .data import (
+from data import (
     ConfigFileSubstitution,
     Defines,
     DirectoryTraversal,
@@ -48,12 +102,12 @@ from .data import (
     XPIDLFile,
 )
 
-from .reader import (
+from reader import (
     MozbuildSandbox,
     SandboxValidationError,
 )
 
-from .gyp_reader import GypSandbox
+from gyp_reader import GypSandbox
 
 
 class TreeMetadataEmitter(LoggingMixin):
@@ -93,8 +147,8 @@ class TreeMetadataEmitter(LoggingMixin):
         def emit_objs(objs):
             for o in objs:
                 yield o
-                if not o._ack:
-                    raise Exception('Unhandled object of type %s' % type(o))
+                #TEMP if not o._ack:
+                #    raise Exception('Unhandled object of type %s' % type(o))
 
         for out in output:
             if isinstance(out, (MozbuildSandbox, GypSandbox)):
@@ -299,7 +353,12 @@ class TreeMetadataEmitter(LoggingMixin):
 
         no_pgo = sandbox.get('NO_PGO')
         sources = sandbox.get('SOURCES', [])
-        no_pgo_sources = [f for f in sources if sources[f].no_pgo]
+        #print (sources)
+        #print sources.__class__
+        #print dir(sources)
+        no_pgo_sources = []
+ 
+        #no_pgo_sources = [f for f in sources if sources[f].no_pgo]
         if no_pgo:
             if no_pgo_sources:
                 raise SandboxValidationError('NO_PGO and SOURCES[...].no_pgo cannot be set at the same time')
@@ -307,7 +366,15 @@ class TreeMetadataEmitter(LoggingMixin):
         if no_pgo_sources:
             passthru.variables['NO_PROFILE_GUIDED_OPTIMIZE'] = no_pgo_sources
 
-        sources_with_flags = [f for f in sources if sources[f].flags]
+        sources_with_flags = []
+        #print "NOTLIST", type(sources), 
+        #print sources, type(sources), sources.index
+        if not type(sources) == list:
+          for f in sources:
+            #print f
+            #print sources[i], type(sources[i]), sources[i].flags
+            if sources[f].flags:
+              sources_with_flags.append(f)
         for f in sources_with_flags:
             ext = mozpath.splitext(f)[1]
             yield PerSourceFlag(sandbox, f, sources[f].flags)
@@ -458,7 +525,7 @@ class TreeMetadataEmitter(LoggingMixin):
             sandbox['TOPSRCDIR']))
         install_prefix = mozpath.join(install_root, install_subdir)
 
-        try:
+        if 1: #try:
             m = manifestparser.TestManifest(manifests=[path], strict=True)
             defaults = m.manifest_defaults[os.path.normpath(path)]
             if not m.tests and not 'support-files' in defaults:
@@ -475,8 +542,10 @@ class TreeMetadataEmitter(LoggingMixin):
             if filter_inactive:
                 # We return tests that don't exist because we want manifests
                 # defining tests that don't exist to result in error.
-                filtered = m.active_tests(exists=False, disabled=False,
-                    **self.mozinfo)
+                #print (self.mozinfo)
+                filtered = []
+                #FIXME filtered = m.active_tests(exists=False, disabled=False,
+                #    **self.mozinfo)
 
                 missing = [t['name'] for t in filtered if not os.path.exists(t['path'])]
                 if missing:
@@ -586,10 +655,10 @@ class TreeMetadataEmitter(LoggingMixin):
                 obj.external_installs.add(mozpath.join(out_dir, f))
 
             yield obj
-        except (AssertionError, Exception):
-            raise SandboxValidationError('Error processing test '
-                'manifest file %s: %s' % (path,
-                    '\n'.join(traceback.format_exception(*sys.exc_info()))))
+        #except (AssertionError, Exception):
+        #    raise SandboxValidationError('Error processing test '
+        #        'manifest file %s: %s' % (path,
+        #            '\n'.join(traceback.format_exception(*sys.exc_info()))))
 
     def _emit_directory_traversal_from_sandbox(self, sandbox):
         o = DirectoryTraversal(sandbox)
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/gyp_reader.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/gyp_reader.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/gyp_reader.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/gyp_reader.py	2014-09-05 15:26:14.086681080 +0200
@@ -1,20 +1,128 @@
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 import gyp
 import sys
 import time
 import os
 import mozpack.path as mozpath
 from mozpack.files import FileFinder
-from .sandbox import (
+from sandbox import (
     alphabetical_sorted,
     GlobalNamespace,
 )
-from .sandbox_symbols import VARIABLES
-from .reader import SandboxValidationError
+from sandbox_symbols import VARIABLES
+from reader import SandboxValidationError
 
 # Define this module as gyp.generator.mozbuild so that gyp can use it
 # as a generator under the name "mozbuild".
@@ -37,7 +145,7 @@ generator_default_variables = {
 for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',
                 'LIB_DIR', 'SHARED_LIB_DIR']:
   # Some gyp steps fail if these are empty(!).
-  generator_default_variables[dirname] = b'dir'
+  generator_default_variables[dirname] = 'dir'
 
 for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',
                'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',
@@ -45,7 +153,7 @@ for unused in ['RULE_INPUT_PATH', 'RULE_
                'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',
                'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX',
                'LINKER_SUPPORTS_ICF']:
-  generator_default_variables[unused] = b''
+  generator_default_variables[unused] = ''
 
 
 class GypSandbox(GlobalNamespace):
@@ -91,9 +199,9 @@ def read_from_gyp(config, path, output,
     str_vars = dict((name, encode(value)) for name, value in vars.items())
 
     params = {
-        b'parallel': False,
-        b'generator_flags': {},
-        b'build_files': [path],
+        'parallel': False,
+        'generator_flags': {},
+        'build_files': [path],
     }
 
     # Files that gyp_chromium always includes
@@ -104,7 +212,7 @@ def read_from_gyp(config, path, output,
 
     # Read the given gyp file and its dependencies.
     generator, flat_list, targets, data = \
-        gyp.Load([path], format=b'mozbuild',
+        gyp.Load([path], format='mozbuild',
             default_variables=str_vars,
             includes=includes,
             depth=encode(mozpath.dirname(path)),
@@ -113,7 +221,7 @@ def read_from_gyp(config, path, output,
     # Process all targets from the given gyp files and its dependencies.
     # The path given to AllTargets needs to use os.sep, while the frontend code
     # gives us paths normalized with forward slash separator.
-    for target in gyp.common.AllTargets(flat_list, targets, path.replace(b'/', os.sep)):
+    for target in gyp.common.AllTargets(flat_list, targets, path.replace('/', os.sep)):
         build_file, target_name, toolset = gyp.common.ParseQualifiedTarget(target)
         # The list of included files returned by gyp are relative to build_file
         included_files = [mozpath.abspath(mozpath.join(mozpath.dirname(build_file), f))
@@ -122,7 +230,8 @@ def read_from_gyp(config, path, output,
         sandbox = GypSandbox(mozpath.abspath(build_file), included_files)
         sandbox.config = config
 
-        with sandbox.allow_all_writes() as d:
+        d = sandbox.allow_all_writes()
+        if 1:
             topsrcdir = d['TOPSRCDIR'] = config.topsrcdir
             d['TOPOBJDIR'] = config.topobjdir
             relsrcdir = d['RELATIVEDIR'] = mozpath.relpath(mozpath.dirname(build_file), config.topsrcdir)
@@ -143,10 +252,11 @@ def read_from_gyp(config, path, output,
             d['OBJDIR'] = mozpath.join(output, reldir, subdir)
             d['IS_GYP_DIR'] = True
 
+        #d.__exit__(0, 0, 0)
         spec = targets[target]
 
         # Derive which gyp configuration to use based on MOZ_DEBUG.
-        c = 'Debug' if config.substs['MOZ_DEBUG'] else 'Release'
+        c = ('Release', 'Debug')[config.substs['MOZ_DEBUG'] == '1']
         if c not in spec['configurations']:
             raise RuntimeError('Missing %s gyp configuration for target %s '
                                'in %s' % (c, target_name, build_file))
@@ -186,9 +296,11 @@ def read_from_gyp(config, path, output,
             for include in target_conf.get('include_dirs', []):
                 sandbox['LOCAL_INCLUDES'] += [include]
 
-            with sandbox.allow_all_writes() as d:
+            d = sandbox.allow_all_writes()
+            if 1:
                 d['EXTRA_ASSEMBLER_FLAGS'] = target_conf.get('asflags_mozilla', [])
                 d['EXTRA_COMPILE_FLAGS'] = target_conf.get('cflags_mozilla', [])
+            #d.__exit__(0, 0, 0)
         else:
             # Ignore other types than static_library because we don't have
             # anything using them, and we're not testing them. They can be
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/mach_commands.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/mach_commands.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/mach_commands.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/mach_commands.py	2014-09-05 15:26:14.086681080 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 from mach.decorators import (
     CommandArgument,
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/reader.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/reader.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/reader.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/reader.py	2014-09-05 15:26:14.087681085 +0200
@@ -20,8 +20,9 @@ execution.
 The BuildReader contains basic logic for traversing a tree of mozbuild files.
 It does this by examining specific variables populated during execution.
 """
-
-from __future__ import print_function, unicode_literals
+import sys
+def print24(msg, file=sys.stdout, end='\n'):
+  file.write(msg + end)
 
 import logging
 import os
@@ -30,8 +31,8 @@ import time
 import traceback
 import types
 
-from collections import OrderedDict
-from io import StringIO
+from mycollections import OrderedDict
+import StringIO
 
 from mozbuild.util import (
     ReadOnlyDefaultDict,
@@ -43,25 +44,25 @@ from mozbuild.backend.configenvironment
 from mozpack.files import FileFinder
 import mozpack.path as mozpath
 
-from .data import (
+from data import (
     AndroidEclipseProjectData,
     JavaJarData,
 )
 
-from .sandbox import (
+from sandbox import (
     SandboxError,
     SandboxExecutionError,
     SandboxLoadError,
     Sandbox,
 )
 
-from .sandbox_symbols import (
+from sandbox_symbols import (
     FUNCTIONS,
     VARIABLES,
 )
 
-if sys.version_info.major == 2:
-    text_type = unicode
+if sys.version_info[0] == 2:
+    text_type = str
     type_type = types.TypeType
 else:
     text_type = str
@@ -69,7 +70,9 @@ else:
 
 
 def log(logger, level, action, params, formatter):
-    logger.log(level, formatter, extra={'action': action, 'params': params})
+    #print(action, formatter)
+    # logger.log(level, formatter, extra={'action': action, 'params': params})
+    logger.log(level, formatter, action, params)
 
 
 def is_read_allowed(path, config):
@@ -124,6 +127,7 @@ class MozbuildSandbox(Sandbox):
         the path of the main mozbuild file that is being executed. It is used
         to compute encountered relative paths.
         """
+        #print path, config
         Sandbox.__init__(self, allowed_variables=VARIABLES)
 
         self._log = logging.getLogger(__name__)
@@ -177,7 +181,8 @@ class MozbuildSandbox(Sandbox):
             config.topobjdir = topobjdir
             self.config = config
 
-        with self._globals.allow_all_writes() as d:
+        d = self._globals.allow_all_writes()
+        if 1:
             d['TOPSRCDIR'] = topsrcdir
             d['TOPOBJDIR'] = topobjdir
             d['RELATIVEDIR'] = reldir
@@ -282,7 +287,8 @@ class MozbuildSandbox(Sandbox):
 
     def _add_tier_directory(self, tier, reldir, static=False, external=False):
         """Register a tier directory with the build."""
-        if isinstance(reldir, text_type):
+        #if isinstance(reldir, text_type):
+        if isinstance(reldir, str):
             reldir = [reldir]
 
         if not tier in self['TIERS']:
@@ -292,7 +298,13 @@ class MozbuildSandbox(Sandbox):
                 'external': [],
             }
 
-        key = 'static' if static else 'external' if external else 'regular'
+        key = None
+        if static:
+          key = 'static'
+        elif external:
+          key = 'external'
+        else:
+          key = 'regular'
         if external and static:
             raise Exception('Only one of external or static can be set at the '
                 'same time')
@@ -336,7 +348,7 @@ class MozbuildSandbox(Sandbox):
 
     def _warning(self, message):
         # FUTURE consider capturing warnings in a variable instead of printing.
-        print('WARNING: %s' % message, file=sys.stderr)
+        print24('WARNING: %s' % message, file=sys.stderr)
 
     def _error(self, message):
         raise SandboxCalledError(self._execution_stack, message)
@@ -671,13 +683,13 @@ class BuildReader(object):
         # In the future, we may traverse moz.build files by looking
         # for DIRS references in the AST, even if a directory is added behind
         # a conditional. For now, just walk the filesystem.
-        ignore = {
+        ignore = (
             # Ignore fake moz.build files used for testing moz.build.
             'python/mozbuild/mozbuild/test',
 
             # Ignore object directories.
             'obj*',
-        }
+        )
 
         finder = FileFinder(self.topsrcdir, find_executables=False,
             ignore=ignore)
@@ -722,28 +734,28 @@ class BuildReader(object):
                 descend=descend, metadata=metadata):
                 yield s
 
-        except BuildReaderError as bre:
-            raise bre
+        #except BuildReaderError, bre:
+        #    raise bre
 
-        except SandboxCalledError as sce:
+        except SandboxCalledError, sce:
             raise BuildReaderError(list(self._execution_stack),
                 sys.exc_info()[2], sandbox_called_error=sce)
 
-        except SandboxExecutionError as se:
-            raise BuildReaderError(list(self._execution_stack),
-                sys.exc_info()[2], sandbox_exec_error=se)
-
-        except SandboxLoadError as sle:
-            raise BuildReaderError(list(self._execution_stack),
-                sys.exc_info()[2], sandbox_load_error=sle)
-
-        except SandboxValidationError as ve:
-            raise BuildReaderError(list(self._execution_stack),
-                sys.exc_info()[2], validation_error=ve)
-
-        except Exception as e:
-            raise BuildReaderError(list(self._execution_stack),
-                sys.exc_info()[2], other_error=e)
+        #except SandboxExecutionError, se:
+        #    raise BuildReaderError(list(self._execution_stack),
+        #        sys.exc_info()[2], sandbox_exec_error=se)
+
+        #except SandboxLoadError, sle:
+        #    raise BuildReaderError(list(self._execution_stack),
+        #        sys.exc_info()[2], sandbox_load_error=sle)
+
+        #except SandboxValidationError, ve:
+        #    raise BuildReaderError(list(self._execution_stack),
+        #        sys.exc_info()[2], validation_error=ve)
+
+        #except Exception, e:
+        #    raise BuildReaderError(list(self._execution_stack),
+        #        sys.exc_info()[2], other_error=e)
 
     def _read_mozbuild(self, path, config, read_tiers, filesystem_absolute,
             descend, metadata):
@@ -760,8 +772,14 @@ class BuildReader(object):
 
         time_start = time.time()
         sandbox = MozbuildSandbox(config, path, metadata=metadata)
+        #print("exec file vvvv %s" % path)
+        #print(sandbox)
+        #print(dir(sandbox))
+ 
         sandbox.exec_file(path, filesystem_absolute=filesystem_absolute)
         sandbox.execution_time = time.time() - time_start
+        #print("exec file ^^^ %s" % path)
+ 
 
         if self._sandbox_post_eval_cb:
             self._sandbox_post_eval_cb(sandbox)
@@ -778,7 +796,7 @@ class BuildReader(object):
                     'The %s variable%s not allowed in such directories.'
                     % (sandbox['RELATIVEDIR'], var, metadata['parent'],
                        ' and '.join(', '.join(matches).rsplit(', ', 1)),
-                       's are' if len(matches) > 1 else ' is'))
+                       ('is', 's are')[len(matches) > 1]))
 
         # We first collect directories populated in variables.
         dir_vars = ['DIRS', 'PARALLEL_DIRS', 'TOOL_DIRS']
@@ -803,7 +821,7 @@ class BuildReader(object):
             # We could emit the parent sandbox before processing gyp
             # configuration, but we need to add the gyp objdirs to that sandbox
             # first.
-            from .gyp_reader import read_from_gyp
+            from gyp_reader import read_from_gyp
             non_unified_sources = set()
             for s in gyp_dir.non_unified_sources:
                 source = mozpath.normpath(mozpath.join(curdir, s))
@@ -842,6 +860,9 @@ class BuildReader(object):
         # It's very tempting to use a set here. Unfortunately, the recursive
         # make backend needs order preserved. Once we autogenerate all backend
         # files, we should be able to convert this to a set.
+        #print("traverse")
+   
+        #print "DIRS in recurse: %s" % dirs
         recurse_info = OrderedDict()
         for var, var_dirs in dirs:
             for d in var_dirs:
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox.py.python3	2014-08-25 15:17:24.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox.py	2014-09-05 15:26:14.087681085 +0200
@@ -20,13 +20,13 @@ KeyError are machine parseable. This mac
 user-friendly error messages in the case of errors.
 """
 
-from __future__ import unicode_literals
+
 
 import copy
 import os
 import sys
 
-from contextlib import contextmanager
+
 
 from mozbuild.util import (
     ReadOnlyDefaultDict,
@@ -83,9 +83,11 @@ class GlobalNamespace(dict):
     arbitrary values. e.g.
 
         ns = GlobalNamespace()
-        with ns.allow_all_writes():
+        ns.allow_all_writes().__enter__()
+        if 1:
             ns['foo'] = True
 
+        ns.allow_all_writes().__exit__(0, 0, 0)
         ns['bar'] = True  # KeyError raised.
     """
 
@@ -128,13 +130,21 @@ class GlobalNamespace(dict):
         self._allow_one_mutation = set()
 
     def __getitem__(self, name):
+        import traceback            
         try:
+            #print(dir(self))
+            #traceback.print_stack()
             return dict.__getitem__(self, name)
         except KeyError:
+            #print self
+            #print "Key error with", name
+            #print "END OF KEY ERROR"
+            #traceback.print_stack()
             pass
 
         # The variable isn't present yet. Fall back to VARIABLES.
         default = self._allowed_variables.get(name, None)
+        #print "default ", default
         if default is None:
             self.last_name_error = KeyError('global_ns', 'get_unknown', name)
             raise self.last_name_error
@@ -143,16 +153,18 @@ class GlobalNamespace(dict):
         # not a class that can be called), then it is actually a rule to
         # generate the default that should be used.
         default = default[0]
+        #print "default2 ", default
         if issubclass(default, SandboxDerivedValue):
             value = default(self)
         else:
             value = default()
-
+        #print "value", value, value.__class__
         dict.__setitem__(self, name, value)
         return dict.__getitem__(self, name)
 
     def __setitem__(self, name, value):
-        if self._allow_all_writes:
+        #if self._allow_all_writes:
+        if 1: #if self._allow_all_writes:
             dict.__setitem__(self, name, value)
             self._allow_one_mutation.add(name)
             return
@@ -198,7 +210,7 @@ class GlobalNamespace(dict):
 
         dict.__setitem__(self, name, value)
 
-    @contextmanager
+    #@contextmanager
     def allow_all_writes(self):
         """Allow any variable to be written to this instance.
 
@@ -208,8 +220,9 @@ class GlobalNamespace(dict):
         whitelisted mutations.
         """
         self._allow_all_writes = True
-        yield self
-        self._allow_all_writes = False
+        return self
+        #yield self
+        #self._allow_all_writes = False
 
     # dict.update doesn't call our __setitem__, so we have to override it.
     def update(self, other):
@@ -337,14 +350,23 @@ class Sandbox(object):
 
         source = None
 
+        #try:
         try:
-            with open(path, 'rt') as fd:
-                source = fd.read()
-        except Exception as e:
+            fd = open(path, 'rt')
+            source = fd.read()
+            fd.close()
+        except Exception, e:
+            #print "Cannot read %s" % path
             raise SandboxLoadError(list(self._execution_stack),
                 sys.exc_info()[2], read_error=path)
 
         self.exec_source(source, path)
+        #except Exception, e:
+        #    pass
+        #except Exception, e:
+        #    raise SandboxLoadError(list(self._execution_stack),
+        #        sys.exc_info()[2], read_error=path)
+
 
     def exec_source(self, source, path):
         """Execute Python code within a string.
@@ -371,10 +393,12 @@ class Sandbox(object):
             # compile() inherits the __future__ from the module by default. We
             # do want Unicode literals.
             code = compile(source, path, 'exec')
+            #print self._globals
             exec(code, self._globals, self._locals)
-        except SandboxError as e:
+        except SandboxError, e:
+            self._execution_stack.pop()
             raise e
-        except NameError as e:
+        except NameError, e:
             # A NameError is raised when a local or global could not be found.
             # The original KeyError has been dropped by the interpreter.
             # However, we should have it cached in our namespace instances!
@@ -389,17 +413,20 @@ class Sandbox(object):
             elif self._locals.last_name_error is not None:
                 actual = self._locals.last_name_error
 
+            self._execution_stack.pop()
             raise SandboxExecutionError(list(self._execution_stack),
                 type(actual), actual, sys.exc_info()[2])
 
-        except Exception as e:
-            # Need to copy the stack otherwise we get a reference and that is
-            # mutated during the finally.
-            exc = sys.exc_info()
-            raise SandboxExecutionError(list(self._execution_stack), exc[0],
-                exc[1], exc[2])
-        finally:
-            self._execution_stack.pop()
+        #except Exception, e:
+        #    # Need to copy the stack otherwise we get a reference and that is
+        #    # mutated during the finally.
+        #    exc = sys.exc_info()
+        #    l = list(self._execution_stack)
+        #    self._execution_stack.pop()
+        #    raise SandboxExecutionError(l, exc[0],
+        #        exc[1], exc[2])
+        #finally:
+        self._execution_stack.pop()
 
     # Dict interface proxies reads to global namespace.
     def __len__(self):
diff -up mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox_symbols.py.python3 mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
--- mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox_symbols.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/frontend/sandbox_symbols.py	2014-09-05 15:26:14.087681085 +0200
@@ -15,20 +15,21 @@ If you are looking for the absolute auth
 the Sandbox consists of, you've come to the right place.
 """
 
-from __future__ import unicode_literals
 
-from collections import OrderedDict
+
+from ordereddict import OrderedDict
 from mozbuild.util import (
     HierarchicalStringList,
     HierarchicalStringListWithFlagsFactory,
     StrictOrderingOnAppendList,
     StrictOrderingOnAppendListWithFlagsFactory,
 )
-from .sandbox import SandboxDerivedValue
+from sandbox import SandboxDerivedValue
 from types import StringTypes
 
+str_type = str
 
-class FinalTargetValue(SandboxDerivedValue, unicode):
+class FinalTargetValue(SandboxDerivedValue, str_type):
     def __new__(cls, sandbox, value=""):
         if not value:
             value = 'dist/'
@@ -38,7 +39,7 @@ class FinalTargetValue(SandboxDerivedVal
                 value += 'bin'
             if sandbox['DIST_SUBDIR']:
                 value += '/' + sandbox['DIST_SUBDIR']
-        return unicode.__new__(cls, value)
+        return str_type.__new__(cls, value)
 
 
 # This defines the set of mutable global variables.
@@ -217,7 +218,7 @@ VARIABLES = {
        files will be installed in the ``/components`` directory of the distribution.
         """, 'libs'),
 
-    'FINAL_LIBRARY': (unicode, unicode,
+    'FINAL_LIBRARY': (str_type, str_type,
         """Library in which the objects of the current directory will be linked.
 
         This variable contains the name of a library, defined elsewhere with
@@ -276,7 +277,7 @@ VARIABLES = {
         likely go away.
         """, None),
 
-    'HOST_LIBRARY_NAME': (unicode, unicode,
+    'HOST_LIBRARY_NAME': (str_type, str_type,
         """Name of target library generated when cross compiling.
         """, 'binaries'),
 
@@ -287,7 +288,7 @@ VARIABLES = {
         populated by calling add_java_jar().
         """, 'binaries'),
 
-    'JS_MODULES_PATH': (unicode, unicode,
+    'JS_MODULES_PATH': (str_type, str_type,
         """Sub-directory of ``$(FINAL_TARGET)`` to install
         ``EXTRA_JS_MODULES``.
 
@@ -297,7 +298,7 @@ VARIABLES = {
         ``$(FINAL_TARGET)/modules``.
         """, None),
 
-    'LIBRARY_NAME': (unicode, unicode,
+    'LIBRARY_NAME': (str_type, str_type,
         """The name of the library generated for a directory.
 
         In ``example/components/moz.build``,::
@@ -335,25 +336,25 @@ VARIABLES = {
 
         This variable contains a list of system libaries to link against.
         """, None),
-    'RCFILE': (unicode, unicode,
+    'RCFILE': (str_type, str_type,
         """The program .rc file.
 
         This variable can only be used on Windows.
         """, None),
 
-    'RESFILE': (unicode, unicode,
+    'RESFILE': (str_type, str_type,
         """The program .res file.
 
         This variable can only be used on Windows.
         """, None),
 
-    'RCINCLUDE': (unicode, unicode,
+    'RCINCLUDE': (str_type, str_type,
         """The resource script file to be included in the default .res file.
 
         This variable can only be used on Windows.
         """, None),
 
-    'DEFFILE': (unicode, unicode,
+    'DEFFILE': (str_type, str_type,
         """The program .def (module definition) file.
 
         This variable can only be used on Windows.
@@ -483,7 +484,7 @@ VARIABLES = {
            EXPORTS.mozilla.dom += ['bar.h']
         """, None),
 
-    'PROGRAM' : (unicode, unicode,
+    'PROGRAM' : (str_type, str_type,
         """Compiled executable name.
 
         If the configuration token ``BIN_SUFFIX`` is set, its value will be
@@ -491,7 +492,7 @@ VARIABLES = {
         ``BIN_SUFFIX``, ``PROGRAM`` will remain unchanged.
         """, 'binaries'),
 
-    'HOST_PROGRAM' : (unicode, unicode,
+    'HOST_PROGRAM' : (str_type, str_type,
         """Compiled host executable name.
 
         If the configuration token ``HOST_BIN_SUFFIX`` is set, its value will be
@@ -523,7 +524,7 @@ VARIABLES = {
         files.
         """, 'libs'),
 
-    'XPIDL_MODULE': (unicode, unicode,
+    'XPIDL_MODULE': (str_type, str_type,
         """XPCOM Interface Definition Module Name.
 
         This is the name of the ``.xpt`` file that is created by linking
@@ -618,14 +619,14 @@ VARIABLES = {
         """, None),
 
     # The following variables are used to control the target of installed files.
-    'XPI_NAME': (unicode, unicode,
+    'XPI_NAME': (str_type, str_type,
         """The name of an extension XPI to generate.
 
         When this variable is present, the results of this directory will end up
         being packaged into an extension instead of the main dist/bin results.
         """, 'libs'),
 
-    'DIST_SUBDIR': (unicode, unicode,
+    'DIST_SUBDIR': (str_type, str_type,
         """The name of an alternate directory to install files to.
 
         When this variable is present, the results of this directory will end up
@@ -633,7 +634,7 @@ VARIABLES = {
         otherwise be placed.
         """, 'libs'),
 
-    'FINAL_TARGET': (FinalTargetValue, unicode,
+    'FINAL_TARGET': (FinalTargetValue, str_type,
         """The name of the directory to install targets to.
 
         The directory is relative to the top of the object directory. The
@@ -645,7 +646,7 @@ VARIABLES = {
 
     'GYP_DIRS': (StrictOrderingOnAppendListWithFlagsFactory({
             'variables': dict,
-            'input': unicode,
+            'input': str_type,
             'sandbox_vars': dict,
             'non_unified_sources': StrictOrderingOnAppendList,
         }), list,
diff -up mozilla-esr31/python/mozbuild/mozbuild/html_build_viewer.py.python3 mozilla-esr31/python/mozbuild/mozbuild/html_build_viewer.py
--- mozilla-esr31/python/mozbuild/mozbuild/html_build_viewer.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/html_build_viewer.py	2014-09-05 15:26:14.087681085 +0200
@@ -4,7 +4,7 @@
 
 # This module contains code for running an HTTP server to view build info.
 
-from __future__ import unicode_literals
+
 
 import BaseHTTPServer
 import json
@@ -36,9 +36,11 @@ class HTTPHandler(BaseHTTPServer.BaseHTT
             self.send_header('Content-Type', 'application/json; charset=utf-8')
             self.end_headers()
 
-            with open(s.json_files[key], 'rb') as fh:
+            fh = open(s.json_files[key], 'rb')
+            if 1:
                 self.wfile.write(fh.read())
 
+            fh.close()
             return
 
         if p == '/':
@@ -78,10 +80,12 @@ class HTTPHandler(BaseHTTPServer.BaseHTT
         self.send_header('Content-Type', ct)
         self.end_headers()
 
-        with open(local_path, 'rb') as fh:
+        fh = open(local_path, 'rb')
+        if 1:
             self.wfile.write(fh.read())
 
 
+        fh.close()
 class BuildViewerServer(object):
     def __init__(self, address='localhost', port=0):
         # TODO use pkg_resources to obtain HTML resources.
diff -up mozilla-esr31/python/mozbuild/mozbuild/jar.py.python3 mozilla-esr31/python/mozbuild/mozbuild/jar.py
--- mozilla-esr31/python/mozbuild/mozbuild/jar.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/jar.py	2014-09-05 15:26:14.087681085 +0200
@@ -165,13 +165,14 @@ class JarMaker(object):
                 'chrome.manifest')
 
         if self.useJarfileManifest:
+            #print chromebasepath
             self.updateManifest(jarPath + '.manifest',
-                                chromebasepath.format(''), register)
+                                chromebasepath %(''), register)
             addEntriesToListFile(chromeManifest,
-                                 ['manifest chrome/{0}.manifest'.format(os.path.basename(jarPath))])
+                                 ['manifest chrome/%s.manifest' % (os.path.basename(jarPath))])
         if self.useChromeManifest:
             self.updateManifest(chromeManifest,
-                                chromebasepath.format('chrome/'),
+                                chromebasepath % ('chrome/'),
                                 register)
 
         # If requested, add a root chrome manifest entry (assumed to be in the parent directory
@@ -289,7 +290,7 @@ class JarMaker(object):
         # {0} is getting replaced with chrome/ for chrome.manifest, and with
         # an empty string for jarfile.manifest
 
-        chromebasepath = '{0}' + os.path.basename(jarfile)
+        chromebasepath = '%s' + os.path.basename(jarfile)
         if self.outputFormat == 'jar':
             chromebasepath = 'jar:' + chromebasepath + '.jar!'
         chromebasepath += '/'
@@ -382,7 +383,7 @@ class JarMaker(object):
         if realsrc is None:
             if jf is not None:
                 jf.close()
-            raise RuntimeError('File "{0}" not found in {1}'.format(src,
+            raise RuntimeError('File "%s" not found in %s' % (src,
                                ', '.join(src_base)))
         if m.group('optPreprocess'):
             outf = outHelper.getOutput(out)
diff -up mozilla-esr31/python/mozbuild/mozbuild/mach_commands.py.python3 mozilla-esr31/python/mozbuild/mozbuild/mach_commands.py
--- mozilla-esr31/python/mozbuild/mozbuild/mach_commands.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/mach_commands.py	2014-09-05 15:26:14.088681090 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import itertools
 import logging
@@ -183,9 +187,11 @@ class BuildProgressFooter(object):
 
                 write_pieces.append(part)
                 written += len(part)
-        with self._t.location():
+        self._t.location().__enter__()
+        if 1:
             self._t.move(self._t.height-1,0)
             self._fh.write(''.join(write_pieces))
+        self._t.location().__exit__(0, 0, 0)
         self._fh.flush()
 
 
@@ -286,7 +292,8 @@ class Build(MachCommandBase):
         monitor = self._spawn(BuildMonitor)
         monitor.init(warnings_path)
 
-        with BuildOutputManager(self.log_manager, monitor) as output:
+        output = BuildOutputManager(self.log_manager, monitor).__enter__()
+        if 1:
             monitor.start()
 
             if what:
@@ -326,8 +333,10 @@ class Build(MachCommandBase):
                                                    add_extra_dependencies)
                     depfile = os.path.join(self.topsrcdir, 'build',
                                            'dumbmake-dependencies')
-                    with open(depfile) as f:
+                    f = open(depfile)
+                    if 1:
                         dm = dependency_map(f.readlines())
+                    f.close()
                     new_pairs = list(add_extra_dependencies(target_pairs, dm))
                     self.log(logging.DEBUG, 'dumbmake',
                              {'target_pairs': target_pairs,
@@ -373,6 +382,7 @@ class Build(MachCommandBase):
 
             monitor.finish(record_usage=status==0)
 
+        output.__exit__(0, 0, 0)
         high_finder, finder_percent = monitor.have_high_finder_usage()
         if high_finder:
             print(FINDER_SLOW_MESSAGE % finder_percent)
@@ -390,7 +400,7 @@ class Build(MachCommandBase):
                         '-message', 'Build complete'], ensure_exit_code=False)
             except which.WhichError:
                 pass
-            except Exception as e:
+            except Exception, e:
                 self.log(logging.WARNING, 'notifier-failed', {'error':
                     e.message}, 'Notification center failed: {error}')
 
@@ -478,7 +488,7 @@ class Build(MachCommandBase):
         try:
             self.remove_objdir()
             return 0
-        except OSError as e:
+        except OSError, e:
             if sys.platform.startswith('win'):
                 if isinstance(e, WindowsError) and e.winerror in (5,32):
                     self.log(logging.ERROR, 'file_access_error', {'error': e},
@@ -598,13 +608,13 @@ class GTestCommands(MachCommandBase):
         # https://code.google.com/p/googletest/wiki/AdvancedGuide#Running_Test_Programs:_Advanced_Options
         gtest_env = {b'GTEST_FILTER': gtest_filter}
 
-        gtest_env[b"MOZ_RUN_GTEST"] = b"True"
+        gtest_env[b"MOZ_RUN_GTEST"] = "True"
 
         if shuffle:
-            gtest_env[b"GTEST_SHUFFLE"] = b"True"
+            gtest_env[b"GTEST_SHUFFLE"] = "True"
 
         if tbpl_parser:
-            gtest_env[b"MOZ_TBPL_PARSER"] = b"True"
+            gtest_env[b"MOZ_TBPL_PARSER"] = "True"
 
         if jobs == 1:
             return self.run_process([app_path, "-unittest"],
@@ -728,7 +738,7 @@ class RunProgram(MachCommandBase):
     def run(self, params, remote, background):
         try:
             args = [self.get_binary_path('app')]
-        except Exception as e:
+        except Exception, e:
             print("It looks like your program isn't built.",
                 "You can run |mach build| to build it.")
             print(e)
@@ -772,7 +782,7 @@ class DebugProgram(MachCommandBase):
         if debugger:
             try:
                 debugger = which.which(debugger)
-            except Exception as e:
+            except Exception, e:
                 print("You don't have %s in your PATH" % (debugger))
                 print(e)
                 return 1
@@ -784,7 +794,7 @@ class DebugProgram(MachCommandBase):
                 try:
                     debugger = which.which('lldb')
                     use_lldb = True
-                except Exception as e:
+                except Exception, e:
                     print("You don't have gdb or lldb in your PATH")
                     print(e)
                     return 1
@@ -803,7 +813,7 @@ class DebugProgram(MachCommandBase):
 
         try:
             binpath = self.get_binary_path('app')
-        except Exception as e:
+        except Exception, e:
             print("It looks like your program isn't built.",
                 "You can run |mach build| to build it.")
             print(e)
@@ -883,7 +893,7 @@ class Makefiles(MachCommandBase):
                 if not statements:
                     print(relpath)
             except pymake.parser.SyntaxError:
-                print('Warning: Could not parse %s' % relpath, file=sys.stderr)
+                print24('Warning: Could not parse %s' % relpath, file=sys.stderr)
 
     def _makefile_ins(self):
         for root, dirs, files in os.walk(self.topsrcdir):
@@ -909,7 +919,7 @@ class MachDebug(MachCommandBase):
 
         try:
             mb = MozbuildObject.from_environment(cwd=self._mach_context.cwd)
-        except ObjdirMismatchException as e:
+        except ObjdirMismatchException, e:
             print('Ambiguous object directory detected. We detected that '
                 'both %s and %s could be object directories. This is '
                 'typically caused by having a mozconfig pointing to a '
@@ -924,11 +934,11 @@ class MachDebug(MachCommandBase):
         try:
             mozconfig = mb.mozconfig
             print('mozconfig path:\n\t%s' % mozconfig['path'])
-        except MozconfigFindException as e:
+        except MozconfigFindException, e:
             print('Unable to find mozconfig: %s' % e.message)
             return 1
 
-        except MozconfigLoadException as e:
+        except MozconfigLoadException, e:
             print('Error loading mozconfig: %s' % e.path)
             print(e.message)
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/makeutil.py.python3 mozilla-esr31/python/mozbuild/mozbuild/makeutil.py
--- mozilla-esr31/python/mozbuild/mozbuild/makeutil.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/makeutil.py	2014-09-05 15:26:14.088681090 +0200
@@ -5,7 +5,9 @@
 import os
 import re
 from types import StringTypes
-from collections import Iterable
+import rhrebase
+print dir(rhrebase)
+from rhrebase import isIterable
 
 
 class Makefile(object):
@@ -101,19 +103,23 @@ class Rule(object):
 
     def add_targets(self, targets):
         '''Add additional targets to the rule.'''
-        assert isinstance(targets, Iterable) and not isinstance(targets, StringTypes)
+        assert isIterable(targets) and not isinstance(targets, StringTypes)
         self._targets.update(targets)
         return self
 
     def add_dependencies(self, deps):
         '''Add dependencies to the rule.'''
-        assert isinstance(deps, Iterable) and not isinstance(deps, StringTypes)
+        #import traceback
+        #traceback.print_stack()
+        #print (deps)
+        #print (dir(deps))
+        assert isIterable(deps) and not isinstance(deps, StringTypes)
         self._dependencies.update(deps)
         return self
 
     def add_commands(self, commands):
         '''Add commands to the rule.'''
-        assert isinstance(commands, Iterable) and not isinstance(commands, StringTypes)
+        assert isIterable(commands) and not isinstance(commands, StringTypes)
         self._commands.extend(commands)
         return self
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/mozconfig.py.python3 mozilla-esr31/python/mozbuild/mozbuild/mozconfig.py
--- mozilla-esr31/python/mozbuild/mozbuild/mozconfig.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/mozconfig.py	2014-09-05 15:26:14.088681090 +0200
@@ -2,14 +2,14 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import filecmp
 import os
 import re
 import subprocess
 
-from collections import defaultdict
+from mycollections import defaultdict
 from mach.mixin.process import ProcessExecutionMixin
 
 
@@ -215,9 +215,10 @@ class MozconfigLoader(ProcessExecutionMi
         try:
             # We need to capture stderr because that's where the shell sends
             # errors if execution fails.
-            output = subprocess.check_output(args, stderr=subprocess.STDOUT,
-                cwd=self.topsrcdir, env=env)
-        except subprocess.CalledProcessError as e:
+            output = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topsrcdir, env=env).communicate()[0]
+            #output = subprocess.check_output(args, stderr=subprocess.STDOUT,
+            #    cwd=self.topsrcdir, env=env)
+        except subprocess.CalledProcessError, e:
             lines = e.output.splitlines()
 
             # Output before actual execution shouldn't be relevant.
@@ -396,7 +397,11 @@ class MozconfigLoader(ProcessExecutionMi
                             current.append(value)
                             continue
                         else:
-                            value = value[:-1] if has_quote else value
+                            #value = None
+                            if has_quote:
+                              value = value[:-1]
+                            else:
+                              value = value
 
                 assert name is not None
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/mozinfo.py.python3 mozilla-esr31/python/mozbuild/mozbuild/mozinfo.py
--- mozilla-esr31/python/mozbuild/mozbuild/mozinfo.py.python3	2014-09-05 15:26:13.971680518 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/mozinfo.py	2014-09-05 15:26:14.088681090 +0200
@@ -7,7 +7,7 @@
 
 import os
 import re
-import json
+import simplejson as json
 import mozbuild.mozconfig as mozconfig
 
 def build_dict(config, env=os.environ):
@@ -36,7 +36,7 @@ def build_dict(config, env=os.environ):
     known_os = {"Linux": "linux",
                 "WINNT": "win",
                 "Darwin": "mac",
-                "Android": "b2g" if substs["MOZ_WIDGET_TOOLKIT"] == "gonk" else "android"}
+                "Android": ("android", "b2g")[substs["MOZ_WIDGET_TOOLKIT"] == "gonk"]}
     if o in known_os:
         d["os"] = known_os[o]
     else:
@@ -91,7 +91,7 @@ def build_dict(config, env=os.environ):
     return d
 
 
-def write_mozinfo(file, config, env=os.environ):
+def write_mozinfo(_file, config, env=os.environ):
     """Write JSON data about the configuration specified in config and an
     environment variable dict to |file|, which may be a filename or file-like
     object.
@@ -99,8 +99,9 @@ def write_mozinfo(file, config, env=os.e
     and what keys are produced.
     """
     build_conf = build_dict(config, env)
-    if isinstance(file, basestring):
-        with open(file, "w") as f:
-            json.dump(build_conf, f)
+    if isinstance(_file, basestring):
+        f = open(_file, "w")
+        json.dump(build_conf, f)
+        f.close()
     else:
-        json.dump(build_conf, file)
+        json.dump(build_conf, _file)
diff -up mozilla-esr31/python/mozbuild/mozbuild/preprocessor.py.python3 mozilla-esr31/python/mozbuild/mozbuild/preprocessor.py
--- mozilla-esr31/python/mozbuild/mozbuild/preprocessor.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/preprocessor.py	2014-09-05 15:26:14.088681090 +0200
@@ -241,7 +241,7 @@ class Expression:
             self.offset = expression.offset
             self.content = expression.content[:3]
         def __str__(self):
-            return 'Unexpected content at offset {0}, "{1}"'.format(self.offset,
+            return 'Unexpected content at offset %d, "%s"' % (self.offset,
                                                                     self.content)
 
 class Context(dict):
@@ -320,9 +320,9 @@ class Preprocessor:
 
     def warnUnused(self, file):
         if self.actionLevel == 0:
-            sys.stderr.write('{0}: WARNING: no preprocessor directives found\n'.format(file))
+            sys.stderr.write('%s: WARNING: no preprocessor directives found\n' % (file))
         elif self.actionLevel == 1:
-            sys.stderr.write('{0}: WARNING: no useful preprocessor directives found\n'.format(file))
+            sys.stderr.write('%s: WARNING: no useful preprocessor directives found\n' % (file))
         pass
 
     def setLineEndings(self, aLE):
@@ -339,8 +339,9 @@ class Preprocessor:
         """
         self.marker = aMarker
         if aMarker:
-            self.instruction = re.compile('{0}(?P<cmd>[a-z]+)(?:\s(?P<args>.*))?$'
-                                          .format(aMarker),
+            #self.instruction = re.compile('%s{0}(?P<cmd>[a-z]+)(?:\s(?P<args>.*))?$'
+            self.instruction = re.compile('%s(?P<cmd>[a-z]+)(?:\s(?P<args>.*))?$'
+                                          % aMarker,
                                           re.U)
             self.comment = re.compile(aMarker, re.U)
         else:
@@ -414,9 +415,7 @@ class Preprocessor:
             self.writtenLines += 1
             ln = self.context['LINE']
             if self.writtenLines != ln:
-                self.out.write('//@line {line} "{file}"{le}'.format(line=ln,
-                                                                    file=self.context['FILE'],
-                                                                    le=self.LE))
+                self.out.write('//@line %s "%s"%s' % (ln, self.context['FILE'], self.LE))
                 self.writtenLines = ln
         filteredLine = self.applyFilters(aLine)
         if filteredLine != aLine:
@@ -436,7 +435,7 @@ class Preprocessor:
             if dir:
                 try:
                     os.makedirs(dir)
-                except OSError as error:
+                except OSError, error:
                     if error.errno != errno.EEXIST:
                         raise
             return open(path, 'wb')
@@ -468,8 +467,10 @@ class Preprocessor:
 
         if includes:
             for f in includes:
-                with open(f, 'rU') as input:
+                input = open(f, 'rU')
+                if 1:
                     self.processFile(input=input, output=out)
+                input.close()
             if depfile:
                 mk = Makefile()
                 mk.create_rule([options.output]).add_dependencies(self.includes)
@@ -793,10 +794,12 @@ def preprocess(includes=[sys.stdin], def
                       defines=defines,
                       marker=marker)
     for f in includes:
-        with open(f, 'rU') as input:
+        input = open(f, 'rU')
+        if 1:
             pp.processFile(input=input, output=output)
 
 
+        input.close()
 # Keep this module independently executable.
 if __name__ == "__main__":
     pp = Preprocessor()
diff -up mozilla-esr31/python/mozbuild/mozbuild/pythonutil.py.python3 mozilla-esr31/python/mozbuild/mozbuild/pythonutil.py
--- mozilla-esr31/python/mozbuild/mozbuild/pythonutil.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/pythonutil.py	2014-09-05 15:26:14.088681090 +0200
@@ -1,4 +1,5 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
+from rhrebase import any
+#from rhrebase import any#from rhrebase import any#from rhrebase import any# This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/sphinx.py.python3 mozilla-esr31/python/mozbuild/mozbuild/sphinx.py
--- mozilla-esr31/python/mozbuild/mozbuild/sphinx.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/sphinx.py	2014-09-05 15:26:14.089681095 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import absolute_import
+
 
 import importlib
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/backend/common.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/backend/common.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/backend/common.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/backend/common.py	2014-09-05 15:26:14.089681095 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import unittest
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_android_eclipse.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_android_eclipse.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_android_eclipse.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_android_eclipse.py	2014-09-05 15:26:14.089681095 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import json
 import os
@@ -64,8 +64,10 @@ class TestAndroidEclipseBackend(BackendT
         self.env = self._consume('android_eclipse', AndroidEclipseBackend)
         self.assertExists('main3', '.classpath')
         # This is brittle but simple.
-        with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main3', '.classpath'), 'rt') as fh:
+        fh = open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main3', '.classpath'), 'rt')
+        if 1:
             lines = fh.readlines()
+        fh.__exit__(0, 0, 0)
         lines = [line.strip() for line in lines]
         self.assertIn('<classpathentry including="**/*.java" kind="src" path="a" />', lines)
         self.assertIn('<classpathentry excluding="b/Excludes.java|b/Excludes2.java" including="**/*.java" kind="src" path="b" />', lines)
@@ -76,14 +78,18 @@ class TestAndroidEclipseBackend(BackendT
         self.env = self._consume('android_eclipse', AndroidEclipseBackend)
 
         self.assertExists('library1', 'project.properties')
-        with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'library1', 'project.properties'), 'rt') as fh:
+        fh = open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'library1', 'project.properties'), 'rt')
+        if 1:
             lines = fh.readlines()
+        fh.__exit__(0, 0, 0)
         lines = [line.strip() for line in lines]
         self.assertIn('android.library=true', lines)
 
         self.assertExists('main1', 'project.properties')
-        with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main1', 'project.properties'), 'rt') as fh:
+        fh = open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main1', 'project.properties'), 'rt').__enter__()
+        if 1:
             lines = fh.readlines()
+        fh.__exit__(0, 0, 0)
         lines = [line.strip() for line in lines]
         self.assertNotIn('android.library=true', lines)
 
@@ -92,8 +98,10 @@ class TestAndroidEclipseBackend(BackendT
         self.env = self._consume('android_eclipse', AndroidEclipseBackend)
         self.assertExists('main4', '.classpath')
         # This is brittle but simple.
-        with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main4', '.classpath'), 'rt') as fh:
+        fh = open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main4', '.classpath'), 'rt').__enter__()
+        if 1:
             lines = fh.readlines()
+        fh.__exit__(0, 0, 0)
         lines = [line.strip() for line in lines]
         self.assertIn('<classpathentry combineaccessrules="false" kind="src" path="/library1" />', lines)
 
@@ -102,8 +110,10 @@ class TestAndroidEclipseBackend(BackendT
         self.env = self._consume('android_eclipse', AndroidEclipseBackend)
         self.assertExists('main2', '.classpath')
         # This is brittle but simple.
-        with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main2', '.classpath'), 'rt') as fh:
+        fh = open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main2', '.classpath'), 'rt').__enter__()
+        if 1:
             lines = fh.readlines()
+        fh.close()
         lines = [line.strip() for line in lines]
         self.assertIn('<classpathentry exported="true" kind="lib" path="%s/main2/extra.jar" />' % self.env.topsrcdir, lines)
 
@@ -112,8 +122,10 @@ class TestAndroidEclipseBackend(BackendT
         self.env = self._consume('android_eclipse', AndroidEclipseBackend)
         self.assertExists('main4', 'project.properties')
         # This is brittle but simple.
-        with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main4', 'project.properties'), 'rt') as fh:
+        fh = open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main4', 'project.properties'), 'rt').__enter__()
+        if 1:
             lines = fh.readlines()
+        fh.close()
         lines = [line.strip() for line in lines]
         self.assertIn('android.library.reference.1=library2', lines)
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_recursivemake.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_recursivemake.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_recursivemake.py	2014-09-05 15:26:14.089681095 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import json
 import os
@@ -414,7 +414,8 @@ class TestRecursiveMakeBackend(BackendTe
         all_tests_path = mozpath.join(env.topobjdir, 'all-tests.json')
         self.assertTrue(os.path.exists(all_tests_path))
 
-        with open(all_tests_path, 'rt') as fh:
+        fh = open(all_tests_path, 'rt')
+        if 1:
             o = json.load(fh)
 
             self.assertIn('xpcshell.js', o)
@@ -422,6 +423,7 @@ class TestRecursiveMakeBackend(BackendTe
 
             self.assertEqual(len(o['xpcshell.js']), 1)
 
+        fh.__exit__(0, 0, 0)
     def test_test_manifest_pattern_matches_recorded(self):
         """Pattern matches in test manifests' support-files should be recorded."""
         env = self._consume('test-manifests-written', RecursiveMakeBackend)
@@ -588,8 +590,7 @@ class TestRecursiveMakeBackend(BackendTe
         for key, expected_rules in expected.iteritems():
             backend_path = mozpath.join(key, 'backend.mk')
             lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
-            found = [str for str in lines if
-                str.startswith('FINAL_TARGET') or str.startswith('XPI_NAME') or
+            found = [str for str in lines if str.startswith('FINAL_TARGET') or str.startswith('XPI_NAME') or
                 str.startswith('DIST_SUBDIR')]
             self.assertEqual(found, expected_rules)
 
@@ -627,9 +628,11 @@ class TestRecursiveMakeBackend(BackendTe
     def test_jar_manifests(self):
         env = self._consume('jar-manifests', RecursiveMakeBackend)
 
-        with open(os.path.join(env.topobjdir, 'backend.mk'), 'rb') as fh:
+        fh = open(os.path.join(env.topobjdir, 'backend.mk'), 'rb')
+        if 1:
             lines = fh.readlines()
 
+        fh.__exit__(0, 0, 0)
         lines = [line.rstrip() for line in lines]
 
         self.assertIn('JAR_MANIFEST := %s/jar.mn' % env.topsrcdir, lines)
@@ -646,9 +649,11 @@ class TestRecursiveMakeBackend(BackendTe
     def test_android_eclipse(self):
         env = self._consume('android_eclipse', RecursiveMakeBackend)
 
-        with open(mozpath.join(env.topobjdir, 'backend.mk'), 'rb') as fh:
+        fh = open(mozpath.join(env.topobjdir, 'backend.mk'), 'rb').__enter__()
+        if 1:
             lines = fh.readlines()
 
+        fh.close()
         lines = [line.rstrip() for line in lines]
 
         # Dependencies first.
@@ -664,9 +669,11 @@ class TestRecursiveMakeBackend(BackendTe
             self.assertIn(command_template % (stem, stem), lines)
 
         # Projects declared in subdirectories.
-        with open(mozpath.join(env.topobjdir, 'subdir', 'backend.mk'), 'rb') as fh:
+        fh = open(mozpath.join(env.topobjdir, 'subdir', 'backend.mk'), 'rb').__enter__()
+        if 1:
             lines = fh.readlines()
 
+        fh.close()
         lines = [line.rstrip() for line in lines]
 
         self.assertIn('ANDROID_ECLIPSE_PROJECT_submain: subtarget1 subtarget2', lines)
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_visualstudio.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_visualstudio.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_visualstudio.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/backend/test_visualstudio.py	2014-09-05 15:26:14.089681095 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from xml.dom.minidom import parse
 import os
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/common.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/common.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/common.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/common.py	2014-09-05 15:26:14.089681095 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/compilation/test_warnings.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/compilation/test_warnings.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/compilation/test_warnings.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/compilation/test_warnings.py	2014-09-05 15:26:14.089681095 +0200
@@ -181,9 +181,11 @@ class TestWarningsDatabase(unittest.Test
 
         w['filename'] = 'DOES_NOT_EXIST'
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             db.insert(w)
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
     def test_pruning(self):
         """Ensure old warnings are removed from database appropriately."""
         db = WarningsDatabase()
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/controller/test_clobber.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/controller/test_clobber.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/controller/test_clobber.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/controller/test_clobber.py	2014-09-05 15:26:14.090681099 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import shutil
@@ -37,9 +37,11 @@ class TestClobberer(unittest.TestCase):
     def get_topsrcdir(self):
         t = self.get_tempdir()
         p = os.path.join(t, 'CLOBBER')
-        with open(p, 'a'):
+        open(p, 'a').__enter__()
+        if 1:
             pass
 
+        open(p, 'a').__exit__(0, 0, 0)
         return t
 
     def test_no_objdir(self):
@@ -77,9 +79,11 @@ class TestClobberer(unittest.TestCase):
         """If CLOBBER in topobjdir is newer, do nothing."""
 
         c = Clobberer(self.get_topsrcdir(), self.get_tempdir())
-        with open(c.obj_clobber, 'a'):
+        open(c.obj_clobber, 'a').__enter__()
+        if 1:
             pass
 
+        open(c.obj_clobber, 'a').__exit__(0, 0, 0)
         required, performed, reason = c.maybe_do_clobber(os.getcwd(), True)
         self.assertFalse(required)
         self.assertFalse(performed)
@@ -89,13 +93,17 @@ class TestClobberer(unittest.TestCase):
         """If CLOBBER in topobjdir is older, we clobber."""
 
         c = Clobberer(self.get_topsrcdir(), self.get_tempdir())
-        with open(c.obj_clobber, 'a'):
+        open(c.obj_clobber, 'a').__enter__()
+        if 1:
             pass
 
+        open(c.obj_clobber, 'a').__exit__(0, 0, 0)
         dummy_path = os.path.join(c.topobjdir, 'foo')
-        with open(dummy_path, 'a'):
+        open(dummy_path, 'a').__enter__()
+        if 1:
             pass
 
+        open(dummy_path, 'a').__exit__(0, 0, 0)
         self.assertTrue(os.path.exists(dummy_path))
 
         old_time = os.path.getmtime(c.src_clobber) - 60
@@ -124,13 +132,17 @@ class TestClobberer(unittest.TestCase):
         """If cwd is topobjdir, we can still clobber."""
         c = Clobberer(self.get_topsrcdir(), self.get_tempdir())
 
-        with open(c.obj_clobber, 'a'):
+        open(c.obj_clobber, 'a').__enter__()
+        if 1:
             pass
 
+        open(c.obj_clobber, 'a').__exit__(0, 0, 0)
         dummy_file = os.path.join(c.topobjdir, 'dummy_file')
-        with open(dummy_file, 'a'):
+        open(dummy_file, 'a').__enter__()
+        if 1:
             pass
 
+        open(dummy_file, 'a').__exit__(0, 0, 0)
         dummy_dir = os.path.join(c.topobjdir, 'dummy_dir')
         os.mkdir(dummy_dir)
 
@@ -154,9 +166,11 @@ class TestClobberer(unittest.TestCase):
 
         c = Clobberer(self.get_topsrcdir(), self.get_tempdir())
 
-        with open(c.obj_clobber, 'a'):
+        open(c.obj_clobber, 'a').__enter__()
+        if 1:
             pass
 
+        open(c.obj_clobber, 'a').__exit__(0, 0, 0)
         old_time = os.path.getmtime(c.src_clobber) - 60
         os.utime(c.obj_clobber, (old_time, old_time))
 
@@ -176,13 +190,17 @@ class TestClobberer(unittest.TestCase):
         topobjdir = self.get_tempdir()
 
         obj_clobber = os.path.join(topobjdir, 'CLOBBER')
-        with open(obj_clobber, 'a'):
+        open(obj_clobber, 'a').__enter__()
+        if 1:
             pass
 
+        open(obj_clobber, 'a').__exit__(0, 0, 0)
         dummy_file = os.path.join(topobjdir, 'dummy_file')
-        with open(dummy_file, 'a'):
+        open(dummy_file, 'a').__enter__()
+        if 1:
             pass
 
+        open(dummy_file, 'a').__exit__(0, 0, 0)
         self.assertTrue(os.path.exists(dummy_file))
 
         old_time = os.path.getmtime(os.path.join(topsrcdir, 'CLOBBER')) - 60
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_emitter.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_emitter.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_emitter.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_emitter.py	2014-09-05 15:26:14.090681099 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import unittest
@@ -299,17 +299,21 @@ class TestEmitterBasic(unittest.TestCase
         """A missing manifest file should result in an error."""
         reader = self.reader('test-manifest-missing-manifest')
 
-        with self.assertRaisesRegexp(SandboxValidationError, 'IOError: Missing files'):
+        self.assertRaisesRegexp(SandboxValidationError, 'IOError: Missing files').__enter__()
+        if 1:
             self.read_topsrcdir(reader)
 
+        self.assertRaisesRegexp(SandboxValidationError, 'IOError: Missing files').__exit__(0, 0, 0)
     def test_empty_test_manifest_rejected(self):
         """A test manifest without any entries is rejected."""
         reader = self.reader('test-manifest-empty')
 
-        with self.assertRaisesRegexp(SandboxValidationError, 'Empty test manifest'):
+        self.assertRaisesRegexp(SandboxValidationError, 'Empty test manifest').__enter__()
+        if 1:
             self.read_topsrcdir(reader)
 
 
+        self.assertRaisesRegexp(SandboxValidationError, 'Empty test manifest').__exit__(0, 0, 0)
     def test_test_manifest_just_support_files(self):
         """A test manifest with no tests but support-files is supported."""
         reader = self.reader('test-manifest-just-support')
@@ -592,10 +596,12 @@ class TestEmitterBasic(unittest.TestCase
             self.assertTrue(os.path.isabs(obj.path))
 
     def test_jar_manifests_multiple_files(self):
-        with self.assertRaisesRegexp(SandboxValidationError, 'limited to one value'):
+        self.assertRaisesRegexp(SandboxValidationError, 'limited to one value').__enter__()
+        if 1:
             reader = self.reader('jar-manifests-multiple-files')
             self.read_topsrcdir(reader)
 
+        self.assertRaisesRegexp(SandboxValidationError, 'limited to one value').__exit__(0, 0, 0)
     def test_xpidl_module_no_sources(self):
         """XPIDL_MODULE without XPIDL_SOURCES should be rejected."""
         with self.assertRaisesRegexp(SandboxValidationError, 'XPIDL_MODULE '
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_namespaces.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_namespaces.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_namespaces.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_namespaces.py	2014-09-05 15:26:14.090681099 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import unittest
 
@@ -27,9 +27,11 @@ class TestGlobalNamespace(unittest.TestC
         # Lowercase keys should be rejected during normal operation.
         ns = GlobalNamespace(allowed_variables=VARIABLES)
 
-        with self.assertRaises(KeyError) as ke:
+        ke = self.assertRaises(KeyError).__enter__()
+        if 1:
             ns['foo'] = True
 
+        ke.__exit__(0, 0, 0)
         e = ke.exception.args
         self.assertEqual(e[0], 'global_ns')
         self.assertEqual(e[1], 'set_unknown')
@@ -37,9 +39,11 @@ class TestGlobalNamespace(unittest.TestC
         self.assertTrue(e[3])
 
         # Unknown uppercase keys should be rejected.
-        with self.assertRaises(KeyError) as ke:
+        ke = self.assertRaises(KeyError).__enter__()
+        if 1:
             ns['FOO'] = True
 
+        ke.__exit__(0, 0, 0)
         e = ke.exception.args
         self.assertEqual(e[0], 'global_ns')
         self.assertEqual(e[1], 'set_unknown')
@@ -58,9 +62,11 @@ class TestGlobalNamespace(unittest.TestC
         ns = GlobalNamespace(allowed_variables=VARIABLES)
 
         # Setting to a non-allowed type should not work.
-        with self.assertRaises(ValueError) as ve:
+        ve = self.assertRaises(ValueError).__enter__()
+        if 1:
             ns['DIRS'] = True
 
+        ve.__exit__(0, 0, 0)
         e = ve.exception.args
         self.assertEqual(e[0], 'global_ns')
         self.assertEqual(e[1], 'set_type')
@@ -71,28 +77,38 @@ class TestGlobalNamespace(unittest.TestC
     def test_allow_all_writes(self):
         ns = GlobalNamespace(allowed_variables=VARIABLES)
 
-        with ns.allow_all_writes() as d:
+        d = ns.allow_all_writes().__enter__()
+        if 1:
             d['foo'] = True
             self.assertTrue(d['foo'])
 
-        with self.assertRaises(KeyError) as ke:
+        d.__exit__(0, 0, 0)
+        ke = self.assertRaises(KeyError).__enter__()
+        if 1:
             ns['bar'] = False
 
+        ke.__exit__(0, 0, 0)
         self.assertEqual(ke.exception.args[1], 'set_unknown')
 
         ns['DIRS'] = []
-        with self.assertRaisesRegexp(Exception, 'Reassigning .* is forbidden') as ke:
+        ke = self.assertRaisesRegexp(Exception, 'Reassigning .* is forbidden').__enter__()
+        if 1:
             ns['DIRS'] = []
 
-        with ns.allow_all_writes() as d:
+        ke.__exit__(0, 0, 0)
+        d = ns.allow_all_writes().__enter__()
+        if 1:
             d['DIST_SUBDIR'] = 'foo'
 
+        d.__exit__(0, 0, 0)
         self.assertEqual(ns['DIST_SUBDIR'], 'foo')
         ns['DIST_SUBDIR'] = 'bar'
         self.assertEqual(ns['DIST_SUBDIR'], 'bar')
-        with self.assertRaisesRegexp(Exception, 'Reassigning .* is forbidden') as ke:
+        ke = self.assertRaisesRegexp(Exception, 'Reassigning .* is forbidden').__enter__()
+        if 1:
             ns['DIST_SUBDIR'] = 'baz'
 
+        ke.__exit__(0, 0, 0)
         self.assertTrue(d['foo'])
 
     def test_key_checking(self):
@@ -124,9 +140,11 @@ class TestLocalNamespace(unittest.TestCa
         self.assertEqual(l['DIRS'], g['DIRS'])
 
         # Reads to missing UPPERCASE vars should result in KeyError.
-        with self.assertRaises(KeyError) as ke:
+        ke = self.assertRaises(KeyError).__enter__()
+        if 1:
             v = l['FOO']
 
+        ke.__exit__(0, 0, 0)
         e = ke.exception
         self.assertEqual(e.args[0], 'global_ns')
         self.assertEqual(e.args[1], 'get_unknown')
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_reader.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_reader.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_reader.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_reader.py	2014-09-05 15:26:14.090681099 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import sys
@@ -85,9 +85,11 @@ class TestBuildReader(unittest.TestCase)
         # add_tier_dir() should fail when not in the top directory.
         reader = self.reader('traversal-tier-fails-in-subdir')
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
     def test_relative_dirs(self):
         # Ensure relative directories are traversed.
         reader = self.reader('traversal-relative-dirs')
@@ -106,15 +108,19 @@ class TestBuildReader(unittest.TestCase)
         # References to directories outside the topsrcdir should fail.
         reader = self.reader('traversal-outside-topsrcdir')
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
     def test_error_basic(self):
         reader = self.reader('reader-error-basic')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertEqual(e.actual_file, self.file_path('reader-error-basic',
             'moz.build'))
@@ -124,9 +130,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_included_from(self):
         reader = self.reader('reader-error-included-from')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertEqual(e.actual_file,
             self.file_path('reader-error-included-from', 'child.build'))
@@ -138,9 +146,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_syntax_error(self):
         reader = self.reader('reader-error-syntax')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('Python syntax error on line 5', str(e))
         self.assertIn('    foo =', str(e))
@@ -149,9 +159,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_read_unknown_global(self):
         reader = self.reader('reader-error-read-unknown-global')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('The error was triggered on line 5', str(e))
         self.assertIn('The underlying problem is an attempt to read', str(e))
@@ -160,9 +172,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_write_unknown_global(self):
         reader = self.reader('reader-error-write-unknown-global')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('The error was triggered on line 7', str(e))
         self.assertIn('The underlying problem is an attempt to write', str(e))
@@ -171,9 +185,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_write_bad_value(self):
         reader = self.reader('reader-error-write-bad-value')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('The error was triggered on line 5', str(e))
         self.assertIn('is an attempt to write an illegal value to a special',
@@ -190,9 +206,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_illegal_path(self):
         reader = self.reader('reader-error-outside-topsrcdir')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('The underlying problem is an illegal file access',
             str(e))
@@ -200,18 +218,22 @@ class TestBuildReader(unittest.TestCase)
     def test_error_missing_include_path(self):
         reader = self.reader('reader-error-missing-include')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('we referenced a path that does not exist', str(e))
 
     def test_error_script_error(self):
         reader = self.reader('reader-error-script-error')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('The error appears to be the fault of the script',
             str(e))
@@ -220,18 +242,22 @@ class TestBuildReader(unittest.TestCase)
     def test_error_bad_dir(self):
         reader = self.reader('reader-error-bad-dir')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('we referenced a path that does not exist', str(e))
 
     def test_error_repeated_dir(self):
         reader = self.reader('reader-error-repeated-dir')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('Directory (foo) registered multiple times in DIRS',
             str(e))
@@ -239,9 +265,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_error_func(self):
         reader = self.reader('reader-error-error-func')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('A moz.build file called the error() function.', str(e))
         self.assertIn('    Some error.', str(e))
@@ -249,9 +277,11 @@ class TestBuildReader(unittest.TestCase)
     def test_error_traversal_tools(self):
         reader = self.reader('reader-error-traversal-tools')
 
-        with self.assertRaises(BuildReaderError) as bre:
+        bre = self.assertRaises(BuildReaderError).__enter__()
+        if 1:
             list(reader.read_topsrcdir())
 
+        bre.__exit__(0, 0, 0)
         e = bre.exception
         self.assertIn('The DIRS variable is not allowed in such directories.', str(e))
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_sandbox.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_sandbox.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_sandbox.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/frontend/test_sandbox.py	2014-09-05 15:26:14.090681099 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import shutil
@@ -95,9 +95,11 @@ class TestSandbox(unittest.TestCase):
         self.assertIsNone(sandbox['CONFIG']['MISSING'])
 
         # Should shouldn't be allowed to assign to the config.
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             sandbox['CONFIG']['FOO'] = ''
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
     def test_dict_interface(self):
         sandbox = self.sandbox()
         config = sandbox.config
@@ -127,9 +129,11 @@ class TestSandbox(unittest.TestCase):
     def test_exec_compile_error(self):
         sandbox = self.sandbox()
 
-        with self.assertRaises(SandboxExecutionError) as se:
+        se = self.assertRaises(SandboxExecutionError).__enter__()
+        if 1:
             sandbox.exec_source('2f23;k;asfj', 'foo.py')
 
+        se.__exit__(0, 0, 0)
         self.assertEqual(se.exception.file_stack, ['foo.py'])
         self.assertIsInstance(se.exception.exc_value, SyntaxError)
         self.assertEqual(sandbox.main_path, 'foo.py')
@@ -137,9 +141,11 @@ class TestSandbox(unittest.TestCase):
     def test_exec_import_denied(self):
         sandbox = self.sandbox()
 
-        with self.assertRaises(SandboxExecutionError) as se:
+        se = self.assertRaises(SandboxExecutionError).__enter__()
+        if 1:
             sandbox.exec_source('import sys', 'import.py')
 
+        se.__exit__(0, 0, 0)
         self.assertIsInstance(se.exception, SandboxExecutionError)
         self.assertEqual(se.exception.exc_type, ImportError)
 
@@ -154,9 +160,11 @@ class TestSandbox(unittest.TestCase):
     def test_exec_source_illegal_key_set(self):
         sandbox = self.sandbox()
 
-        with self.assertRaises(SandboxExecutionError) as se:
+        se = self.assertRaises(SandboxExecutionError).__enter__()
+        if 1:
             sandbox.exec_source('ILLEGAL = True', 'foo.py')
 
+        se.__exit__(0, 0, 0)
         e = se.exception
         self.assertIsInstance(e.exc_value, KeyError)
 
@@ -216,9 +224,11 @@ add_tier_dir('t1', 'bat', static=True)
 
         sandbox.exec_source('add_tier_dir("t1", "foo")', 'foo.py')
 
-        with self.assertRaises(SandboxExecutionError):
+        self.assertRaises(SandboxExecutionError).__enter__()
+        if 1:
             sandbox.exec_source('add_tier_dir("t1", "foo")', 'foo.py')
 
+        self.assertRaises(SandboxExecutionError).__exit__(0, 0, 0)
     def test_include_basic(self):
         sandbox = self.sandbox(data_path='include-basic')
 
@@ -232,9 +242,11 @@ add_tier_dir('t1', 'bat', static=True)
     def test_include_outside_topsrcdir(self):
         sandbox = self.sandbox(data_path='include-outside-topsrcdir')
 
-        with self.assertRaises(SandboxLoadError) as se:
+        se = self.assertRaises(SandboxLoadError).__enter__()
+        if 1:
             sandbox.exec_file('relative.build')
 
+        se.__exit__(0, 0, 0)
         expected = mozpath.join(test_data_path, 'moz.build')
         self.assertEqual(se.exception.illegal_path, expected)
 
@@ -242,9 +254,11 @@ add_tier_dir('t1', 'bat', static=True)
         # Ensure the path stack is reported properly in exceptions.
         sandbox = self.sandbox(data_path='include-file-stack')
 
-        with self.assertRaises(SandboxExecutionError) as se:
+        se = self.assertRaises(SandboxExecutionError).__enter__()
+        if 1:
             sandbox.exec_file('moz.build')
 
+        se.__exit__(0, 0, 0)
         e = se.exception
         self.assertIsInstance(e.exc_value, KeyError)
 
@@ -261,9 +275,11 @@ add_tier_dir('t1', 'bat', static=True)
     def test_include_missing(self):
         sandbox = self.sandbox(data_path='include-missing')
 
-        with self.assertRaises(SandboxLoadError) as sle:
+        sle = self.assertRaises(SandboxLoadError).__enter__()
+        if 1:
             sandbox.exec_file('moz.build')
 
+        sle.__exit__(0, 0, 0)
         self.assertIsNotNone(sle.exception.read_error)
 
     def test_include_relative_from_child_dir(self):
@@ -288,9 +304,11 @@ add_tier_dir('t1', 'bat', static=True)
     def test_error(self):
         sandbox = self.sandbox()
 
-        with self.assertRaises(SandboxCalledError) as sce:
+        sce = self.assertRaises(SandboxCalledError).__enter__()
+        if 1:
             sandbox.exec_source('error("This is an error.")', 'test.py')
 
+        sce.__exit__(0, 0, 0)
         e = sce.exception
         self.assertEqual(e.message, 'This is an error.')
 
@@ -315,9 +333,11 @@ add_tier_dir('t1', 'bat', static=True)
     def test_invalid_exports_set_base(self):
         sandbox = self.sandbox()
 
-        with self.assertRaises(SandboxExecutionError) as se:
+        se = self.assertRaises(SandboxExecutionError).__enter__()
+        if 1:
             sandbox.exec_source('EXPORTS = "foo.h"', 'foo.py')
 
+        se.__exit__(0, 0, 0)
         self.assertEqual(se.exception.exc_type, ValueError)
 
 if __name__ == '__main__':
diff -up mozilla-esr31/python/mozbuild/mozbuild/testing.py.python3 mozilla-esr31/python/mozbuild/mozbuild/testing.py
--- mozilla-esr31/python/mozbuild/mozbuild/testing.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/testing.py	2014-09-05 15:26:14.090681099 +0200
@@ -2,15 +2,15 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import json
 import os
 
 import mozpack.path as mozpath
 
-from .base import MozbuildObject
-from .util import DefaultOnReadDict
+from base import MozbuildObject
+from util import DefaultOnReadDict
 
 
 def rewrite_test_base(test, new_base, honor_install_to_subdir=False):
@@ -49,7 +49,8 @@ class TestMetadata(object):
         self._test_dirs = set()
 
         if filename:
-            with open(filename, 'rt') as fh:
+            fh = open(filename, 'rt')
+            if 1:
                 d = json.load(fh)
 
                 for path, tests in d.items():
@@ -60,6 +61,7 @@ class TestMetadata(object):
                         flavor = metadata.get('flavor')
                         self._tests_by_flavor[flavor].add(path)
 
+            fh.close()
     def tests_with_flavor(self, flavor):
         """Obtain all tests having the specified flavor.
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_base.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_base.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_base.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_base.py	2014-09-05 15:26:14.091681104 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import json
 import os
@@ -49,7 +49,8 @@ class TestMozbuildObject(unittest.TestCa
     def test_objdir_config_guess(self):
         base = self.get_base()
 
-        with NamedTemporaryFile() as mozconfig:
+        mozconfig = NamedTemporaryFile().__enter__()
+        if 1:
             os.environ[b'MOZCONFIG'] = mozconfig.name
 
             self.assertIsNotNone(base.topobjdir)
@@ -58,11 +59,13 @@ class TestMozbuildObject(unittest.TestCa
             self.assertTrue(os.path.isabs(base.topobjdir))
             self.assertTrue(base.topobjdir.startswith(topsrcdir))
 
+        mozconfig.__exit__(0, 0, 0)
     def test_objdir_trailing_slash(self):
         """Trailing slashes in topobjdir should be removed."""
         base = self.get_base()
 
-        with NamedTemporaryFile() as mozconfig:
+        mozconfig = NamedTemporaryFile().__enter__()
+        if 1:
             mozconfig.write('mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/foo/')
             mozconfig.flush()
             os.environ[b'MOZCONFIG'] = mozconfig.name
@@ -71,6 +74,7 @@ class TestMozbuildObject(unittest.TestCa
                 'foo'))
             self.assertTrue(base.topobjdir.endswith('foo'))
 
+        mozconfig.__exit__(0, 0, 0)
     @unittest.skip('Failing on buildbot.')
     def test_objdir_config_status(self):
         """Ensure @CONFIG_GUESS@ is handled when loading mozconfig."""
@@ -82,8 +86,10 @@ class TestMozbuildObject(unittest.TestCa
         d = os.path.realpath(tempfile.mkdtemp())
         try:
             mozconfig = os.path.join(d, 'mozconfig')
-            with open(mozconfig, 'wt') as fh:
+            fh = open(mozconfig, 'wt')
+            if 1:
                 fh.write('mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/foo/@CONFIG_GUESS@')
+            fh.__exit__(0, 0, 0)
             print('Wrote mozconfig %s' % mozconfig)
 
             topobjdir = os.path.join(d, 'foo', guess)
@@ -96,12 +102,14 @@ class TestMozbuildObject(unittest.TestCa
                 'config.guess',), guess_path)
 
             mozinfo = os.path.join(topobjdir, 'mozinfo.json')
-            with open(mozinfo, 'wt') as fh:
+            fh = open(mozinfo, 'wt')
+            if 1:
                 json.dump(dict(
                     topsrcdir=d,
                     mozconfig=mozconfig,
                 ), fh)
 
+            fh.__exit__(0, 0, 0)
             os.environ[b'MOZCONFIG'] = mozconfig
             os.chdir(topobjdir)
 
@@ -117,19 +125,23 @@ class TestMozbuildObject(unittest.TestCa
         d = os.path.realpath(tempfile.mkdtemp())
         try:
             mozconfig = os.path.join(d, 'mozconfig')
-            with open(mozconfig, 'wt') as fh:
+            fh = open(mozconfig, 'wt').__enter__()
+            if 1:
                 fh.write('mk_add_options MOZ_OBJDIR=./objdir')
 
+            fh.__exit__(0, 0, 0)
             topobjdir = os.path.join(d, 'objdir')
             os.mkdir(topobjdir)
 
             mozinfo = os.path.join(topobjdir, 'mozinfo.json')
-            with open(mozinfo, 'wt') as fh:
+            fh = open(mozinfo, 'wt').__enter__()
+            if 1:
                 json.dump(dict(
                     topsrcdir=d,
                     mozconfig=mozconfig,
                 ), fh)
 
+            fh.__exit__(0, 0, 0)
             os.environ[b'MOZCONFIG'] = mozconfig
             child = os.path.join(topobjdir, 'foo', 'bar')
             os.makedirs(child)
@@ -154,16 +166,20 @@ class TestMozbuildObject(unittest.TestCa
             os.symlink(topobjdir_real, topobjdir_link)
 
             mozconfig = os.path.join(d, 'mozconfig')
-            with open(mozconfig, 'wt') as fh:
+            fh = open(mozconfig, 'wt').__enter__()
+            if 1:
                 fh.write('mk_add_options MOZ_OBJDIR=%s' % topobjdir_link)
 
+            fh.__exit__(0, 0, 0)
             mozinfo = os.path.join(topobjdir_real, 'mozinfo.json')
-            with open(mozinfo, 'wt') as fh:
+            fh = open(mozinfo, 'wt').__enter__()
+            if 1:
                 json.dump(dict(
                     topsrcdir=d,
                     mozconfig=mozconfig,
                 ), fh)
 
+            fh.__exit__(0, 0, 0)
             os.chdir(topobjdir_link)
             obj = MozbuildObject.from_environment(detect_virtualenv_mozinfo=False)
             self.assertEqual(obj.topobjdir, topobjdir_real)
@@ -189,11 +205,13 @@ class TestMozbuildObject(unittest.TestCa
             os.makedirs(topsrcdir)
 
             mozinfo = os.path.join(topobjdir, 'mozinfo.json')
-            with open(mozinfo, 'wt') as fh:
+            fh = open(mozinfo, 'wt').__enter__()
+            if 1:
                 json.dump(dict(
                     topsrcdir=topsrcdir,
                 ), fh)
 
+            fh.close()
             os.chdir(topobjdir)
 
             class MockMachContext(object):
@@ -222,14 +240,18 @@ class TestMozbuildObject(unittest.TestCa
             # The easiest way to do this is to create a mozinfo.json with data
             # that will never happen.
             mozinfo = os.path.join(d, 'mozinfo.json')
-            with open(mozinfo, 'wt') as fh:
+            fh = open(mozinfo, 'wt').__enter__()
+            if 1:
                 json.dump({'topsrcdir': d}, fh)
 
+            fh.close()
             os.chdir(d)
 
-            with self.assertRaises(BadEnvironmentException):
+            self.assertRaises(BadEnvironmentException).__enter__()
+            if 1:
                 MozbuildObject.from_environment(detect_virtualenv_mozinfo=False)
 
+            self.assertRaises(BadEnvironmentException).__exit__(0, 0, 0)
         finally:
             shutil.rmtree(d)
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_containers.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_containers.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_containers.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_containers.py	2014-09-05 15:26:14.091681104 +0200
@@ -21,12 +21,16 @@ class TestReadOnlyDict(unittest.TestCase
         self.assertEqual(original, test)
         self.assertEqual(test['foo'], 1)
 
-        with self.assertRaises(KeyError):
+        self.assertRaises(KeyError).__enter__()
+        if 1:
             value = test['missing']
 
-        with self.assertRaises(Exception):
+        self.assertRaises(KeyError).__exit__(0, 0, 0)
+        self.assertRaises(Exception).__enter__()
+        if 1:
             test['baz'] = True
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
 class TestDefaultOnReadDict(unittest.TestCase):
     def test_no_defaults(self):
         original = {'foo': 1, 'bar': 2}
@@ -34,9 +38,11 @@ class TestDefaultOnReadDict(unittest.Tes
         test = DefaultOnReadDict(original)
         self.assertEqual(original, test)
 
-        with self.assertRaises(KeyError):
+        self.assertRaises(KeyError).__enter__()
+        if 1:
             value = test['missing']
 
+        self.assertRaises(KeyError).__exit__(0, 0, 0)
         test['foo'] = 5
         self.assertEqual(test['foo'], 5)
 
@@ -48,9 +54,11 @@ class TestDefaultOnReadDict(unittest.Tes
         self.assertEqual(original, test)
         self.assertEqual(test['baz'], 3)
 
-        with self.assertRaises(KeyError):
+        self.assertRaises(KeyError).__enter__()
+        if 1:
             value = test['missing']
 
+        self.assertRaises(KeyError).__exit__(0, 0, 0)
         test['baz'] = 4
         self.assertEqual(test['baz'], 4)
 
@@ -85,15 +93,19 @@ class TestReadOnlyDefaultDict(unittest.T
 
         self.assertEqual(test['foo'], 1)
 
-        with self.assertRaises(KeyError):
+        self.assertRaises(KeyError).__enter__()
+        if 1:
             value = test['missing']
 
+        self.assertRaises(KeyError).__exit__(0, 0, 0)
     def test_assignment(self):
         test = ReadOnlyDefaultDict({})
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             test['foo'] = True
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
     def test_defaults(self):
         test = ReadOnlyDefaultDict({}, defaults={'foo': 1})
 
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_mozconfig.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_mozconfig.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_mozconfig.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_mozconfig.py	2014-09-05 15:26:14.091681104 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import unittest
@@ -54,9 +54,11 @@ class TestMozconfigLoader(unittest.TestC
 
         os.environ[b'MOZ_MYCONFIG'] = '/foo'
 
-        with self.assertRaises(MozconfigFindException) as e:
+        e = self.assertRaises(MozconfigFindException).__enter__()
+        if 1:
             self.get_loader().find_mozconfig()
 
+        e.__exit__(0, 0, 0)
         self.assertTrue(e.exception.message.startswith('The MOZ_MYCONFIG'))
 
     def test_find_multiple_configs(self):
@@ -70,14 +72,18 @@ class TestMozconfigLoader(unittest.TestC
         loader = MozconfigLoader(srcdir)
         for d in dirs:
             path = os.path.join(d, relative_mozconfig)
-            with open(path, 'wb') as f:
+            f = open(path, 'wb')
+            if 1:
                 f.write(path)
 
+            f.close()
         orig_dir = os.getcwd()
         try:
             os.chdir(curdir)
-            with self.assertRaises(MozconfigFindException) as e:
+            e = self.assertRaises(MozconfigFindException).__enter__()
+            if 1:
                 loader.find_mozconfig()
+            e.__exit__(0, 0, 0)
         finally:
             os.chdir(orig_dir)
 
@@ -98,9 +104,11 @@ class TestMozconfigLoader(unittest.TestC
 
         loader = MozconfigLoader(srcdir)
         path = os.path.join(srcdir, relative_mozconfig)
-        with open(path, 'w'):
+        open(path, 'w').__enter__()
+        if 1:
             pass
 
+        open(path, 'w').__exit__(0, 0, 0)
         orig_dir = os.getcwd()
         try:
             os.chdir(curdir)
@@ -122,8 +130,10 @@ class TestMozconfigLoader(unittest.TestC
         orig_dir = os.getcwd()
         try:
             os.chdir(curdir)
-            with self.assertRaises(MozconfigFindException) as e:
+            e = self.assertRaises(MozconfigFindException).__enter__()
+            if 1:
                 loader.find_mozconfig()
+            e.__exit__(0, 0, 0)
         finally:
             os.chdir(orig_dir)
 
@@ -142,9 +152,11 @@ class TestMozconfigLoader(unittest.TestC
         loader = MozconfigLoader(srcdir)
 
         path = os.path.join(srcdir, relative_mozconfig)
-        with open(path, 'w'):
+        open(path, 'w').__enter__()
+        if 1:
             pass
 
+        open(path, 'w').__exit__(0, 0, 0)
         orig_dir = os.getcwd()
         try:
             os.chdir(curdir)
@@ -157,9 +169,11 @@ class TestMozconfigLoader(unittest.TestC
         """Ensure a missing absolute path is detected."""
         os.environ[b'MOZCONFIG'] = '/foo/bar/does/not/exist'
 
-        with self.assertRaises(MozconfigFindException) as e:
+        e = self.assertRaises(MozconfigFindException).__enter__()
+        if 1:
             self.get_loader().find_mozconfig()
 
+        e.__exit__(0, 0, 0)
         self.assertIn('path that does not exist', e.exception.message)
         self.assertTrue(e.exception.message.endswith('/foo/bar/does/not/exist'))
 
@@ -168,9 +182,11 @@ class TestMozconfigLoader(unittest.TestC
 
         os.environ[b'MOZCONFIG'] = gettempdir()
 
-        with self.assertRaises(MozconfigFindException) as e:
+        e = self.assertRaises(MozconfigFindException).__enter__()
+        if 1:
             self.get_loader().find_mozconfig()
 
+        e.__exit__(0, 0, 0)
         self.assertIn('refers to a non-file', e.exception.message)
         self.assertTrue(e.exception.message.endswith(gettempdir()))
 
@@ -180,9 +196,11 @@ class TestMozconfigLoader(unittest.TestC
             d = self.get_temp_dir()
             path = os.path.join(d, p)
 
-            with open(path, 'w'):
+            open(path, 'w').__enter__()
+            if 1:
                 pass
 
+            open(path, 'w').__exit__(0, 0, 0)
             self.assertEqual(MozconfigLoader(d).find_mozconfig(), path)
 
     def test_find_multiple_defaults(self):
@@ -191,12 +209,16 @@ class TestMozconfigLoader(unittest.TestC
 
         d = self.get_temp_dir()
         for p in MozconfigLoader.DEFAULT_TOPSRCDIR_PATHS:
-            with open(os.path.join(d, p), 'w'):
+            open(os.path.join(d, p), 'w').__enter__()
+            if 1:
                 pass
 
-        with self.assertRaises(MozconfigFindException) as e:
+            open(os.path.join(d, p), 'w').__exit__(0, 0, 0)
+        e = self.assertRaises(MozconfigFindException).__enter__()
+        if 1:
             MozconfigLoader(d).find_mozconfig()
 
+        e.__exit__(0, 0, 0)
         self.assertIn('Multiple default mozconfig files present',
             e.exception.message)
 
@@ -204,12 +226,16 @@ class TestMozconfigLoader(unittest.TestC
         """Ensure we error when deprecated path locations are present."""
         for p in MozconfigLoader.DEPRECATED_TOPSRCDIR_PATHS:
             d = self.get_temp_dir()
-            with open(os.path.join(d, p), 'w'):
+            open(os.path.join(d, p), 'w').__enter__()
+            if 1:
                 pass
 
-            with self.assertRaises(MozconfigFindException) as e:
+            open(os.path.join(d, p), 'w').__exit__(0, 0, 0)
+            e = self.assertRaises(MozconfigFindException).__enter__()
+            if 1:
                 MozconfigLoader(d).find_mozconfig()
 
+            e.__exit__(0, 0, 0)
             self.assertIn('This implicit location is no longer',
                 e.exception.message)
             self.assertIn(d, e.exception.message)
@@ -222,12 +248,16 @@ class TestMozconfigLoader(unittest.TestC
             os.environ[b'HOME'] = home
             path = os.path.join(home, p)
 
-            with open(path, 'w'):
+            open(path, 'w').__enter__()
+            if 1:
                 pass
 
-            with self.assertRaises(MozconfigFindException) as e:
+            open(path, 'w').__exit__(0, 0, 0)
+            e = self.assertRaises(MozconfigFindException).__enter__()
+            if 1:
                 self.get_loader().find_mozconfig()
 
+            e.__exit__(0, 0, 0)
             self.assertIn('This implicit location is no longer',
                 e.exception.message)
             self.assertIn(path, e.exception.message)
@@ -246,7 +276,8 @@ class TestMozconfigLoader(unittest.TestC
         })
 
     def test_read_empty_mozconfig(self):
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             result = self.get_loader().read_mozconfig(mozconfig.name)
 
             self.assertEqual(result['path'], mozconfig.name)
@@ -260,9 +291,11 @@ class TestMozconfigLoader(unittest.TestC
 
             self.assertGreater(len(result['env']['unmodified']), 0)
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_capture_ac_options(self):
         """Ensures ac_add_options calls are captured."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('ac_add_options --enable-debug\n')
             mozconfig.write('ac_add_options --disable-tests --enable-foo\n')
             mozconfig.write('ac_add_options --foo="bar baz"\n')
@@ -273,9 +306,11 @@ class TestMozconfigLoader(unittest.TestC
                 '--enable-debug', '--disable-tests', '--enable-foo',
                 '--foo=bar baz'])
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_ac_options_substitution(self):
         """Ensure ac_add_options values are substituted."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('ac_add_options --foo=@TOPSRCDIR@\n')
             mozconfig.flush()
 
@@ -284,8 +319,10 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEqual(result['configure_args'], [
                 '--foo=%s' % loader.topsrcdir])
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_ac_app_options(self):
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('ac_add_options --foo=@TOPSRCDIR@\n')
             mozconfig.write('ac_add_app_options app1 --bar=@TOPSRCDIR@\n')
             mozconfig.write('ac_add_app_options app2 --bar=x\n')
@@ -302,9 +339,11 @@ class TestMozconfigLoader(unittest.TestC
                 '--foo=%s' % loader.topsrcdir,
                 '--bar=x'])
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_capture_mk_options(self):
         """Ensures mk_add_options calls are captured."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('mk_add_options MOZ_OBJDIR=/foo/bar\n')
             mozconfig.write('mk_add_options MOZ_MAKE_FLAGS=-j8\n')
             mozconfig.write('mk_add_options FOO="BAR BAZ"\n')
@@ -316,9 +355,11 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEqual(result['make_flags'], '-j8')
             self.assertEqual(result['make_extra'], ['FOO=BAR BAZ', 'BIZ=1'])
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_moz_objdir_substitution(self):
         """Ensure @TOPSRCDIR@ substitution is recognized in MOZ_OBJDIR."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/some-objdir')
             mozconfig.flush()
 
@@ -328,9 +369,11 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEqual(result['topobjdir'], '%s/some-objdir' %
                 loader.topsrcdir)
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_new_variables(self):
         """New variables declared in mozconfig file are detected."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('CC=/usr/local/bin/clang\n')
             mozconfig.write('CXX=/usr/local/bin/clang++\n')
             mozconfig.flush()
@@ -341,9 +384,11 @@ class TestMozconfigLoader(unittest.TestC
                 'CC': '/usr/local/bin/clang',
                 'CXX': '/usr/local/bin/clang++'})
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_exported_variables(self):
         """Exported variables are caught as new variables."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('export MY_EXPORTED=woot\n')
             mozconfig.flush()
 
@@ -352,11 +397,13 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEqual(result['env']['added'], {
                 'MY_EXPORTED': 'woot'})
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_modify_variables(self):
         """Variables modified by mozconfig are detected."""
-        os.environ[b'CC'] = b'/usr/bin/gcc'
+        os.environ[b'CC'] = '/usr/bin/gcc'
 
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('CC=/usr/local/bin/clang\n')
             mozconfig.flush()
 
@@ -366,11 +413,13 @@ class TestMozconfigLoader(unittest.TestC
                 'CC': ('/usr/bin/gcc', '/usr/local/bin/clang')
             })
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_removed_variables(self):
         """Variables unset by the mozconfig are detected."""
-        os.environ[b'CC'] = b'/usr/bin/clang'
+        os.environ[b'CC'] = '/usr/bin/clang'
 
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('unset CC\n')
             mozconfig.flush()
 
@@ -379,9 +428,11 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEqual(result['env']['removed'], {
                 'CC': '/usr/bin/clang'})
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_multiline_variables(self):
         """Ensure multi-line variables are captured properly."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('multi="foo\nbar"\n')
             mozconfig.write('single=1\n')
             mozconfig.flush()
@@ -393,9 +444,11 @@ class TestMozconfigLoader(unittest.TestC
                 'single': '1'
             })
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_topsrcdir_defined(self):
         """Ensure $topsrcdir references work as expected."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('TEST=$topsrcdir')
             mozconfig.flush()
 
@@ -405,9 +458,11 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEqual(result['env']['added']['TEST'],
                 loader.topsrcdir.replace(os.sep, '/'))
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_empty_variable_value(self):
         """Ensure empty variable values are parsed properly."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('EMPTY=\n')
             mozconfig.flush()
 
@@ -416,16 +471,20 @@ class TestMozconfigLoader(unittest.TestC
             self.assertIn('EMPTY', result['env']['added'])
             self.assertEqual(result['env']['added']['EMPTY'], '')
 
+        mozconfig.__exit__(0, 0, 0)
     def test_read_load_exception(self):
         """Ensure non-0 exit codes in mozconfigs are handled properly."""
-        with NamedTemporaryFile(mode='w') as mozconfig:
+        mozconfig = NamedTemporaryFile(mode='w').__enter__()
+        if 1:
             mozconfig.write('echo "hello world"\n')
             mozconfig.write('exit 1\n')
             mozconfig.flush()
 
-            with self.assertRaises(MozconfigLoadException) as e:
+            e = self.assertRaises(MozconfigLoadException).__enter__()
+            if 1:
                 self.get_loader().read_mozconfig(mozconfig.name)
 
+            e.__exit__(0, 0, 0)
             self.assertTrue(e.exception.message.startswith(
                 'Evaluation of your mozconfig exited with an error'))
             self.assertEquals(e.exception.path,
@@ -433,5 +492,6 @@ class TestMozconfigLoader(unittest.TestC
             self.assertEquals(e.exception.output, ['hello world'])
 
 
+        mozconfig.__exit__(0, 0, 0)
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_mozinfo.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_mozinfo.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_mozinfo.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_mozinfo.py	2014-09-05 15:26:14.091681104 +0200
@@ -34,15 +34,21 @@ class TestBuildDict(unittest.TestCase, B
         Test that missing required values raises.
         """
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             build_dict(self._config(substs=dict(OS_TARGET='foo')))
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__exit__(0, 0, 0)
+        self.assertRaises(Exception).__enter__()
+        if 1:
             build_dict(self._config(substs=dict(TARGET_CPU='foo')))
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__exit__(0, 0, 0)
+        self.assertRaises(Exception).__enter__()
+        if 1:
             build_dict(self._config(substs=dict(MOZ_WIDGET_TOOLKIT='foo')))
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
     def test_win(self):
         d = build_dict(self._config(dict(
             OS_TARGET='WINNT',
@@ -242,11 +248,13 @@ class TestWriteMozinfo(unittest.TestCase
         ))
         tempdir = tempfile.tempdir
         c.topsrcdir = tempdir
-        with NamedTemporaryFile(dir=os.path.normpath(c.topsrcdir)) as mozconfig:
+        mozconfig = NamedTemporaryFile(dir=os.path.normpath(c.topsrcdir)).__enter__()
+        if 1:
             mozconfig.write('unused contents')
             mozconfig.flush()
             write_mozinfo(self.f, c, {'MOZCONFIG': mozconfig.name})
-            with open(self.f) as f:
+            f = open(self.f)
+            if 1:
                 d = json.load(f)
                 self.assertEqual('win', d['os'])
                 self.assertEqual('x86', d['processor'])
@@ -255,6 +263,8 @@ class TestWriteMozinfo(unittest.TestCase
                 self.assertEqual(mozconfig.name, d['mozconfig'])
                 self.assertEqual(32, d['bits'])
 
+            f.close()
+        mozconfig.__exit__(0, 0, 0)
     def test_fileobj(self):
         """
         Test that writing to a file-like object produces correct output.
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_preprocessor.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_preprocessor.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_preprocessor.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_preprocessor.py	2014-09-05 15:26:14.091681104 +0200
@@ -28,10 +28,12 @@ class TestPreprocessor(unittest.TestCase
         content = '%s' % '\n'.join(content_lines)
         expected = '%s'.rstrip() % '\n'.join(expected_lines)
 
-        with MockedOpen({'dummy': content}):
+        MockedOpen({'dummy': content}).__enter__()
+        if 1:
             self.pp.do_include('dummy')
             self.assertEqual(self.pp.out.getvalue().rstrip('\n'), expected)
 
+        MockedOpen({'dummy': content}).__exit__(0, 0, 0)
     def do_include_pass(self, content_lines):
         self.do_include_compare(content_lines, ['PASS'])
 
@@ -267,18 +269,23 @@ class TestPreprocessor(unittest.TestCase
         ])
 
     def test_error(self):
-        with MockedOpen({'f': '#error spit this message out\n'}):
-            with self.assertRaises(Preprocessor.Error) as e:
+        MockedOpen({'f': '#error spit this message out\n'}).__enter__()
+        if 1:
+            e = self.assertRaises(Preprocessor.Error).__enter__()
+            if 1:
                 self.pp.do_include('f')
                 self.assertEqual(e.args[0][-1], 'spit this message out')
 
+            e.__exit__(0, 0, 0)
+        MockedOpen({'f': '#error spit this message out\n'}).__exit__(0, 0, 0)
     def test_javascript_line(self):
         # The preprocessor is reading the filename from somewhere not caught
         # by MockedOpen.
         tmpdir = mkdtemp()
         try:
             full = os.path.join(tmpdir, 'javascript_line.js.in')
-            with open(full, 'w') as fh:
+            fh = open(full, 'w')
+            if 1:
                 fh.write('\n'.join([
                     '// Line 1',
                     '#if 0',
@@ -296,6 +303,7 @@ class TestPreprocessor(unittest.TestCase
                     '',
                 ]))
 
+            fh.close()
             self.pp.do_include(full)
             out = '\n'.join([
                 '// Line 1',
@@ -441,11 +449,13 @@ class TestPreprocessor(unittest.TestCase
         ])
 
     def test_lineEndings(self):
-        with MockedOpen({'f': 'first\n#literal second\n'}):
+        MockedOpen({'f': 'first\n#literal second\n'}).__enter__()
+        if 1:
             self.pp.setLineEndings('cr')
             self.pp.do_include('f')
             self.assertEqual(self.pp.out.getvalue(), "first\rsecond\r")
 
+        MockedOpen({'f': 'first\n#literal second\n'}).__exit__(0, 0, 0)
     def test_filterDefine(self):
         self.do_include_pass([
             '#filter substitution',
@@ -532,11 +542,15 @@ class TestPreprocessor(unittest.TestCase
         ])
 
     def test_undefined_variable(self):
-        with MockedOpen({'f': '#filter substitution\n@foo@'}):
-            with self.assertRaises(Preprocessor.Error) as e:
+        MockedOpen({'f': '#filter substitution\n@foo@'}).__enter__()
+        if 1:
+            e = self.assertRaises(Preprocessor.Error).__enter__()
+            if 1:
                 self.pp.do_include('f')
                 self.assertEqual(e.key, 'UNDEFINED_VAR')
 
+            e.__exit__(0, 0, 0)
+        MockedOpen({'f': '#filter substitution\n@foo@'}).__exit__(0, 0, 0)
     def test_include(self):
         files = {
             'foo/test': '\n'.join([
@@ -558,36 +572,50 @@ class TestPreprocessor(unittest.TestCase
             ]),
         }
 
-        with MockedOpen(files):
+        MockedOpen(files).__enter__()
+        if 1:
             self.pp.do_include('f')
             self.assertEqual(self.pp.out.getvalue(), 'foobarbaz\nbarfoobaz\n')
 
+        MockedOpen(files).__exit__(0, 0, 0)
     def test_include_missing_file(self):
-        with MockedOpen({'f': '#include foo\n'}):
-            with self.assertRaises(Preprocessor.Error) as e:
+        MockedOpen({'f': '#include foo\n'}).__enter__()
+        if 1:
+            e = self.assertRaises(Preprocessor.Error).__enter__()
+            if 1:
                 self.pp.do_include('f')
                 self.assertEqual(e.key, 'FILE_NOT_FOUND')
 
+            e.__exit__(0, 0, 0)
+        MockedOpen({'f': '#include foo\n'}).__exit__(0, 0, 0)
     def test_include_undefined_variable(self):
-        with MockedOpen({'f': '#filter substitution\n#include @foo@\n'}):
-            with self.assertRaises(Preprocessor.Error) as e:
+        MockedOpen({'f': '#filter substitution\n#include @foo@\n'}).__enter__()
+        if 1:
+            e = self.assertRaises(Preprocessor.Error).__enter__()
+            if 1:
                 self.pp.do_include('f')
                 self.assertEqual(e.key, 'UNDEFINED_VAR')
 
+            e.__exit__(0, 0, 0)
+        MockedOpen({'f': '#filter substitution\n#include @foo@\n'}).__exit__(0, 0, 0)
     def test_include_literal_at(self):
         files = {
             '@foo@': '#define foo foobarbaz\n',
             'f': '#include @foo@\n#filter substitution\n@foo@\n',
         }
 
-        with MockedOpen(files):
+        MockedOpen(files).__enter__()
+        if 1:
             self.pp.do_include('f')
             self.assertEqual(self.pp.out.getvalue(), 'foobarbaz\n')
 
+        MockedOpen(files).__exit__(0, 0, 0)
     def test_command_line_literal_at(self):
-        with MockedOpen({"@foo@.in": '@foo@\n'}):
+        MockedOpen({"@foo@.in": '@foo@\n'}).__enter__()
+        if 1:
             self.pp.handleCommandLine(['-Fsubstitution', '-Dfoo=foobarbaz', '@foo@.in'])
             self.assertEqual(self.pp.out.getvalue(), 'foobarbaz\n')
 
+        MockedOpen({"@foo@.in": '@foo@\n'}).__exit__(0, 0, 0)
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_testing.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_testing.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_testing.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_testing.py	2014-09-05 15:26:14.092681109 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import shutil
@@ -21,7 +21,7 @@ from mozbuild.testing import (
 )
 
 
-ALL_TESTS_JSON = b'''
+ALL_TESTS_JSON = '''
 {
     "accessible/tests/mochitest/actions/test_anchors.html": [
         {
@@ -175,9 +175,11 @@ class TestTestResolver(Base):
         topobjdir = tempfile.mkdtemp()
         self._temp_dirs.append(topobjdir)
 
-        with open(os.path.join(topobjdir, 'all-tests.json'), 'wt') as fh:
+        fh = open(os.path.join(topobjdir, 'all-tests.json'), 'wt')
+        if 1:
             fh.write(ALL_TESTS_JSON)
 
+        fh.close()
         o = MozbuildObject(self.FAKE_TOPSRCDIR, None, None, topobjdir=topobjdir)
 
         return o._spawn(TestResolver)
diff -up mozilla-esr31/python/mozbuild/mozbuild/test/test_util.py.python3 mozilla-esr31/python/mozbuild/mozbuild/test/test_util.py
--- mozilla-esr31/python/mozbuild/mozbuild/test/test_util.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/test/test_util.py	2014-09-05 15:26:14.092681109 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import hashlib
 import os
@@ -41,7 +41,7 @@ data_path = os.path.join(data_path, 'dat
 class TestHashing(unittest.TestCase):
     def test_hash_file_known_hash(self):
         """Ensure a known hash value is recreated."""
-        data = b'The quick brown fox jumps over the lazy cog'
+        data = 'The quick brown fox jumps over the lazy cog'
         expected = 'de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3'
 
         temp = NamedTemporaryFile()
@@ -54,7 +54,7 @@ class TestHashing(unittest.TestCase):
 
     def test_hash_file_large(self):
         """Ensure that hash_file seems to work with a large file."""
-        data = b'x' * 1048576
+        data = 'x' * 1048576
 
         hasher = hashlib.sha1()
         hasher.update(data)
@@ -71,7 +71,8 @@ class TestHashing(unittest.TestCase):
 
 class TestFileAvoidWrite(unittest.TestCase):
     def test_file_avoid_write(self):
-        with MockedOpen({'file': 'content'}):
+        MockedOpen({'file': 'content'}).__enter__()
+        if 1:
             # Overwriting an existing file replaces its content
             faw = FileAvoidWrite('file')
             faw.write('bazqux')
@@ -84,12 +85,17 @@ class TestFileAvoidWrite(unittest.TestCa
             self.assertEqual(faw.close(), (False, True))
             self.assertEqual(open('file2').read(), 'content')
 
-        with MockedOpen({'file': 'content'}):
-            with FileAvoidWrite('file') as file:
+        MockedOpen({'file': 'content'}).__exit__(0, 0, 0)
+        MockedOpen({'file': 'content'}).__enter__()
+        if 1:
+            file = FileAvoidWrite('file').__enter__()
+            if 1:
                 file.write('foobar')
 
+            file.__exit__(0, 0, 0)
             self.assertEqual(open('file', 'r').read(), 'foobar')
 
+        MockedOpen({'file': 'content'}).__exit__(0, 0, 0)
         class MyMockedOpen(MockedOpen):
             '''MockedOpen extension to raise an exception if something
             attempts to write in an opened file.
@@ -99,7 +105,8 @@ class TestFileAvoidWrite(unittest.TestCa
                     raise Exception, 'Unexpected open with write mode'
                 return MockedOpen.__call__(self, name, mode)
 
-        with MyMockedOpen({'file': 'content'}):
+        MyMockedOpen({'file': 'content'}).__enter__()
+        if 1:
             # Validate that MyMockedOpen works as intended
             file = FileAvoidWrite('file')
             file.write('foobar')
@@ -111,19 +118,23 @@ class TestFileAvoidWrite(unittest.TestCa
             faw.write('content')
             self.assertEqual(faw.close(), (True, False))
 
+        MyMockedOpen({'file': 'content'}).__exit__(0, 0, 0)
     def test_diff_not_default(self):
         """Diffs are not produced by default."""
 
-        with MockedOpen({'file': 'old'}):
+        MockedOpen({'file': 'old'}).__enter__()
+        if 1:
             faw = FileAvoidWrite('file')
             faw.write('dummy')
             faw.close()
             self.assertIsNone(faw.diff)
 
+        MockedOpen({'file': 'old'}).__exit__(0, 0, 0)
     def test_diff_update(self):
         """Diffs are produced on file update."""
 
-        with MockedOpen({'file': 'old'}):
+        MockedOpen({'file': 'old'}).__enter__()
+        if 1:
             faw = FileAvoidWrite('file', capture_diff=True)
             faw.write('new')
             faw.close()
@@ -132,6 +143,7 @@ class TestFileAvoidWrite(unittest.TestCa
             self.assertIn('-old', diff)
             self.assertIn('+new', diff)
 
+        MockedOpen({'file': 'old'}).__exit__(0, 0, 0)
     def test_diff_create(self):
         """Diffs are produced when files are created."""
 
@@ -228,43 +240,55 @@ class TestHierarchicalStringList(unittes
         self.assertEqual(self.EXPORTS.foo.bar.get_strings(), ["foobar.h"])
 
     def test_invalid_exports_append(self):
-        with self.assertRaises(ValueError) as ve:
+        ve = self.assertRaises(ValueError).__enter__()
+        if 1:
             self.EXPORTS += "foo.h"
+        ve.__exit__(0, 0, 0)
         self.assertEqual(str(ve.exception),
                          "Expected a list of strings, not <type '%s'>" % str_type)
 
     def test_invalid_exports_set(self):
-        with self.assertRaises(ValueError) as ve:
+        ve = self.assertRaises(ValueError).__enter__()
+        if 1:
             self.EXPORTS.foo = "foo.h"
 
+        ve.__exit__(0, 0, 0)
         self.assertEqual(str(ve.exception),
                          "Expected a list of strings, not <type '%s'>" % str_type)
 
     def test_invalid_exports_append_base(self):
-        with self.assertRaises(ValueError) as ve:
+        ve = self.assertRaises(ValueError).__enter__()
+        if 1:
             self.EXPORTS += "foo.h"
 
+        ve.__exit__(0, 0, 0)
         self.assertEqual(str(ve.exception),
                          "Expected a list of strings, not <type '%s'>" % str_type)
 
     def test_invalid_exports_bool(self):
-        with self.assertRaises(ValueError) as ve:
+        ve = self.assertRaises(ValueError).__enter__()
+        if 1:
             self.EXPORTS += [True]
 
+        ve.__exit__(0, 0, 0)
         self.assertEqual(str(ve.exception),
                          "Expected a list of strings, not an element of "
                          "<type 'bool'>")
 
     def test_del_exports(self):
-        with self.assertRaises(MozbuildDeletionError) as mde:
+        mde = self.assertRaises(MozbuildDeletionError).__enter__()
+        if 1:
             self.EXPORTS.foo += ['bar.h']
             del self.EXPORTS.foo
 
+        mde.__exit__(0, 0, 0)
     def test_unsorted_appends(self):
-        with self.assertRaises(UnsortedError) as ee:
+        ee = self.assertRaises(UnsortedError).__enter__()
+        if 1:
             self.EXPORTS += ['foo.h', 'bar.h']
 
 
+        ee.__exit__(0, 0, 0)
 class TestStrictOrderingOnAppendList(unittest.TestCase):
     def test_init(self):
         l = StrictOrderingOnAppendList()
@@ -273,9 +297,11 @@ class TestStrictOrderingOnAppendList(uni
         l = StrictOrderingOnAppendList(['a', 'b', 'c'])
         self.assertEqual(len(l), 3)
 
-        with self.assertRaises(UnsortedError):
+        self.assertRaises(UnsortedError).__enter__()
+        if 1:
             StrictOrderingOnAppendList(['c', 'b', 'a'])
 
+        self.assertRaises(UnsortedError).__exit__(0, 0, 0)
         self.assertEqual(len(l), 3)
 
     def test_extend(self):
@@ -284,9 +310,11 @@ class TestStrictOrderingOnAppendList(uni
         self.assertEqual(len(l), 2)
         self.assertIsInstance(l, StrictOrderingOnAppendList)
 
-        with self.assertRaises(UnsortedError):
+        self.assertRaises(UnsortedError).__enter__()
+        if 1:
             l.extend(['d', 'c'])
 
+        self.assertRaises(UnsortedError).__exit__(0, 0, 0)
         self.assertEqual(len(l), 2)
 
     def test_slicing(self):
@@ -295,9 +323,11 @@ class TestStrictOrderingOnAppendList(uni
         self.assertEqual(len(l), 2)
         self.assertIsInstance(l, StrictOrderingOnAppendList)
 
-        with self.assertRaises(UnsortedError):
+        self.assertRaises(UnsortedError).__enter__()
+        if 1:
             l[:] = ['b', 'a']
 
+        self.assertRaises(UnsortedError).__exit__(0, 0, 0)
         self.assertEqual(len(l), 2)
 
     def test_add(self):
@@ -307,9 +337,11 @@ class TestStrictOrderingOnAppendList(uni
         self.assertEqual(len(l2), 2)
         self.assertIsInstance(l2, StrictOrderingOnAppendList)
 
-        with self.assertRaises(UnsortedError):
+        self.assertRaises(UnsortedError).__enter__()
+        if 1:
             l2 = l + ['b', 'a']
 
+        self.assertRaises(UnsortedError).__exit__(0, 0, 0)
         self.assertEqual(len(l), 0)
 
     def test_iadd(self):
@@ -318,9 +350,11 @@ class TestStrictOrderingOnAppendList(uni
         self.assertEqual(len(l), 2)
         self.assertIsInstance(l, StrictOrderingOnAppendList)
 
-        with self.assertRaises(UnsortedError):
+        self.assertRaises(UnsortedError).__enter__()
+        if 1:
             l += ['b', 'a']
 
+        self.assertRaises(UnsortedError).__exit__(0, 0, 0)
         self.assertEqual(len(l), 2)
 
 
@@ -334,19 +368,25 @@ class TestStrictOrderingOnAppendListWith
         l = cls()
         l += ['a', 'b']
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             l['a'] = 'foo'
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__exit__(0, 0, 0)
+        self.assertRaises(Exception).__enter__()
+        if 1:
             c = l['c']
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
         self.assertEqual(l['a'].foo, False)
         l['a'].foo = True
         self.assertEqual(l['a'].foo, True)
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             l['a'].bar = 'bar'
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         self.assertEqual(l['a'].bar, 0)
         l['a'].bar = 42
         self.assertEqual(l['a'].bar, 42)
@@ -354,10 +394,12 @@ class TestStrictOrderingOnAppendListWith
         l['b'].foo = True
         self.assertEqual(l['b'].foo, True)
 
-        with self.assertRaises(AttributeError):
+        self.assertRaises(AttributeError).__enter__()
+        if 1:
             l['b'].baz = False
 
 
+        self.assertRaises(AttributeError).__exit__(0, 0, 0)
 class TestHierarchicalStringListWithFlagsFactory(unittest.TestCase):
     def test_hierarchical_string_list_with_flags_factory(self):
         cls = HierarchicalStringListWithFlagsFactory({
@@ -368,19 +410,25 @@ class TestHierarchicalStringListWithFlag
         l = cls()
         l += ['a', 'b']
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             l['a'] = 'foo'
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__exit__(0, 0, 0)
+        self.assertRaises(Exception).__enter__()
+        if 1:
             c = l['c']
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
         self.assertEqual(l['a'].foo, False)
         l['a'].foo = True
         self.assertEqual(l['a'].foo, True)
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             l['a'].bar = 'bar'
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         self.assertEqual(l['a'].bar, 0)
         l['a'].bar = 42
         self.assertEqual(l['a'].bar, 42)
@@ -388,24 +436,32 @@ class TestHierarchicalStringListWithFlag
         l['b'].foo = True
         self.assertEqual(l['b'].foo, True)
 
-        with self.assertRaises(AttributeError):
+        self.assertRaises(AttributeError).__enter__()
+        if 1:
             l['b'].baz = False
 
+        self.assertRaises(AttributeError).__exit__(0, 0, 0)
         l.x += ['x', 'y']
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__enter__()
+        if 1:
             l.x['x'] = 'foo'
 
-        with self.assertRaises(Exception):
+        self.assertRaises(Exception).__exit__(0, 0, 0)
+        self.assertRaises(Exception).__enter__()
+        if 1:
             c = l.x['c']
 
+        self.assertRaises(Exception).__exit__(0, 0, 0)
         self.assertEqual(l.x['x'].foo, False)
         l.x['x'].foo = True
         self.assertEqual(l.x['x'].foo, True)
 
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             l.x['x'].bar = 'bar'
 
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         self.assertEqual(l.x['x'].bar, 0)
         l.x['x'].bar = 42
         self.assertEqual(l.x['x'].bar, 42)
@@ -413,9 +469,11 @@ class TestHierarchicalStringListWithFlag
         l.x['y'].foo = True
         self.assertEqual(l.x['y'].foo, True)
 
-        with self.assertRaises(AttributeError):
+        self.assertRaises(AttributeError).__enter__()
+        if 1:
             l.x['y'].baz = False
 
 
+        self.assertRaises(AttributeError).__exit__(0, 0, 0)
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/python/mozbuild/mozbuild/util.py.python3 mozilla-esr31/python/mozbuild/mozbuild/util.py
--- mozilla-esr31/python/mozbuild/mozbuild/util.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/util.py	2014-09-05 15:26:14.092681109 +0200
@@ -1,3 +1,4 @@
+from rhrebase import all
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -5,12 +6,12 @@
 # This file contains miscellaneous utility functions that don't belong anywhere
 # in particular.
 
-from __future__ import unicode_literals
+
 
 import copy
 import difflib
 import errno
-import hashlib
+import sha
 import os
 import stat
 import sys
@@ -29,9 +30,10 @@ def hash_file(path):
 
     # If the hashing function changes, this may invalidate lots of cached data.
     # Don't change it lightly.
-    h = hashlib.sha1()
+    h = sha.sha()
 
-    with open(path, 'rb') as fh:
+    fh = open(path, 'rb')
+    if 1:
         while True:
             data = fh.read(8192)
 
@@ -40,6 +42,7 @@ def hash_file(path):
 
             h.update(data)
 
+    fh.close()
     return h.hexdigest()
 
 
@@ -122,7 +125,10 @@ class FileAvoidWrite(StringIO):
     could add unwanted overhead to calls.
     """
     def __init__(self, filename, capture_diff=False):
-        StringIO.__init__(self)
+        StringIO.__init__(self )
+        #super(type(FileAvoidWrite), self).__init__()
+        #print "SELF BUF", self.buf
+        #super(FileAvoidWrite, self).__init__()
         self.name = filename
         self._capture_diff = capture_diff
         self.diff = None
@@ -138,7 +144,8 @@ class FileAvoidWrite(StringIO):
         underlying file was changed, ``.diff`` will be populated with the diff
         of the result.
         """
-        buf = self.getvalue()
+        buf = self.getvalue( )
+        #buf = self.buf
         StringIO.close(self)
         existed = False
         old_content = None
@@ -155,16 +162,23 @@ class FileAvoidWrite(StringIO):
                     return True, False
             except IOError:
                 pass
-            finally:
+            if 1:
                 existing.close()
 
+
         ensureParentDir(self.name)
-        with open(self.name, 'w') as file:
+        file = open(self.name, 'w')
+        if 1:
             file.write(buf)
 
+        file.close()
         if self._capture_diff:
             try:
-                old_lines = old_content.splitlines() if old_content else []
+                old_lines = None
+                if old_content:
+                  old_lines = old_content.splitlines()
+                else:
+                  old_lines = []
                 new_lines = buf.splitlines()
 
                 self.diff = difflib.unified_diff(old_lines, new_lines,
@@ -181,8 +195,15 @@ class FileAvoidWrite(StringIO):
         return existed, True
 
     def __enter__(self):
+        import traceback
+        #print "ENTER:", self.buf
+        #traceback.print_stack()
         return self
     def __exit__(self, type, value, traceback):
+        #print "EXIT"
+        import traceback
+        #traceback.print_stack()
+        #print self.buf
         self.close()
 
 
@@ -551,7 +572,7 @@ class LockFile(object):
             try:
                 os.remove(self.lockfile)
                 break
-            except OSError as e:
+            except OSError, e:
                 if e.errno == errno.EACCES:
                     # Another process probably has the file open, we'll retry.
                     # Just a short sleep since we want to drop the lock ASAP
@@ -576,7 +597,7 @@ def lock_file(lockfile, max_wait = 600):
             fd = os.open(lockfile, os.O_EXCL | os.O_RDWR | os.O_CREAT)
             # We created the lockfile, so we're the owner
             break
-        except OSError as e:
+        except OSError, e:
             if (e.errno == errno.EEXIST or
                 (sys.platform == "win32" and e.errno == errno.EACCES)):
                 pass
@@ -589,7 +610,7 @@ def lock_file(lockfile, max_wait = 600):
             # and read its contents to report the owner PID
             f = open(lockfile, 'r')
             s = os.stat(lockfile)
-        except EnvironmentError as e:
+        except EnvironmentError, e:
             if e.errno == errno.ENOENT or e.errno == errno.EACCES:
             # We didn't create the lockfile, so it did exist, but it's
             # gone now. Just try again
@@ -613,7 +634,7 @@ def lock_file(lockfile, max_wait = 600):
     # if we get here. we have the lockfile. Convert the os.open file
     # descriptor into a Python file object and record our PID in it
     f = os.fdopen(fd, 'w')
-    f.write('{0}\n'.format(os.getpid()))
+    f.write('%d\n' %(os.getpid()))
     f.close()
 
     return LockFile(lockfile)
diff -up mozilla-esr31/python/mozbuild/mozbuild/virtualenv.py.python3 mozilla-esr31/python/mozbuild/mozbuild/virtualenv.py
--- mozilla-esr31/python/mozbuild/mozbuild/virtualenv.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozbuild/virtualenv.py	2014-09-05 15:26:14.092681109 +0200
@@ -1,11 +1,65 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This file contains code for populating the virtualenv environment for
 # Mozilla's build system. It is typically called as part of configure.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file=sys.stdout):
+  print file, msg
+  file.write(msg)
 
 import distutils.sysconfig
 import os
@@ -18,7 +72,7 @@ from distutils.version import StrictVers
 
 
 # Minimum version of Python required to build.
-MINIMUM_PYTHON_VERSION = StrictVersion('2.7.3')
+MINIMUM_PYTHON_VERSION = StrictVersion('2.4')
 MINIMUM_PYTHON_MAJOR = 2
 
 
@@ -140,7 +194,9 @@ class VirtualenvManager(object):
         args = [sys.executable, self.virtualenv_script_path,
             self.virtualenv_root]
 
-        result = subprocess.call(args, stdout=self.log_handle,
+#        result = subprocess.call(args, stdout=self.log_handle,
+#            stderr=subprocess.STDOUT, env=env)
+        result = subprocess.call(args,
             stderr=subprocess.STDOUT, env=env)
 
         if result:
@@ -149,9 +205,11 @@ class VirtualenvManager(object):
         return self.virtualenv_root
 
     def packages(self):
-        with file(self.manifest_path, 'rU') as fh:
+        fh = file(self.manifest_path, 'rU')
+        if 1:
             packages = [line.rstrip().split(':')
                         for line in fh]
+        fh.close()
         return packages
 
     def populate(self):
@@ -234,7 +292,8 @@ class VirtualenvManager(object):
 
                 path = os.path.join(self.topsrcdir, package[1])
 
-                with open(os.path.join(python_lib, package[0]), 'a') as f:
+                f = open(os.path.join(python_lib, package[0]), 'a')
+                if 1:
                     # This path is relative to the .pth file.  Using a
                     # relative path allows the srcdir/objdir combination
                     # to be moved around (as long as the paths relative to
@@ -245,6 +304,7 @@ class VirtualenvManager(object):
                         # When objdir is on a separate drive, relpath throws
                         f.write("%s\n" % os.path.join(python_lib, path))
 
+                f.close()
                 return True
 
             if package[0] == 'optional':
@@ -252,18 +312,18 @@ class VirtualenvManager(object):
                     handle_package(package[1:])
                     return True
                 except:
-                    print('Error processing command. Ignoring', \
-                        'because optional. (%s)' % ':'.join(package),
-                        file=self.log_handle)
+                    print24('Error processing command. Ignoring because optional. (%s)' % ':'.join(package))
                     return False
 
             if package[0] == 'objdir':
                 assert len(package) == 2
                 path = os.path.join(self.topobjdir, package[1])
 
-                with open(os.path.join(python_lib, 'objdir.pth'), 'a') as f:
+                f = open(os.path.join(python_lib, 'objdir.pth'), 'a')
+                if 1:
                     f.write('%s\n' % path)
 
+                f.close()
                 return True
 
             raise Exception('Unknown action: %s' % package[0])
@@ -354,7 +414,7 @@ class VirtualenvManager(object):
         try:
             output = subprocess.check_output(program, cwd=directory, stderr=subprocess.STDOUT)
             print(output)
-        except subprocess.CalledProcessError as e:
+        except subprocess.CalledProcessError, e:
             if 'Python.h: No such file or directory' in e.output:
                 print('WARNING: Python.h not found. Install Python development headers.')
             else:
@@ -458,7 +518,7 @@ if __name__ == '__main__':
 
     topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[1:5]
     populate = False
-
+    #print "MANIFEST PATH", manifest_path
     # This should only be called internally.
     if sys.argv[1] == 'populate':
         populate = True
diff -up mozilla-esr31/python/mozbuild/mozpack/chrome/flags.py.python3 mozilla-esr31/python/mozbuild/mozpack/chrome/flags.py
--- mozilla-esr31/python/mozbuild/mozpack/chrome/flags.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/chrome/flags.py	2014-09-05 15:26:14.093681114 +0200
@@ -5,7 +5,7 @@
 import re
 from distutils.version import LooseVersion
 from mozpack.errors import errors
-from collections import OrderedDict
+from ordereddict import OrderedDict
 
 
 class Flag(object):
diff -up mozilla-esr31/python/mozbuild/mozpack/chrome/manifest.py.python3 mozilla-esr31/python/mozbuild/mozpack/chrome/manifest.py
--- mozilla-esr31/python/mozbuild/mozpack/chrome/manifest.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/chrome/manifest.py	2014-09-05 15:26:14.093681114 +0200
@@ -8,7 +8,7 @@ from urlparse import urlparse
 import mozpack.path
 from mozpack.chrome.flags import Flags
 from mozpack.errors import errors
-
+from rhrebase import all, any
 
 class ManifestEntry(object):
     '''
@@ -196,8 +196,8 @@ class ManifestOverload(ManifestEntry):
     @property
     def localized(self):
         u = urlparse(self.overload)
-        return u.scheme == 'chrome' and \
-               u.path.split('/')[0:2] == ['', 'locale']
+        return u[0] == 'chrome' and \
+               u[1].split('/')[0:2] == ['', 'locale']
 
 
 class ManifestOverlay(ManifestOverload):
@@ -246,8 +246,10 @@ class ManifestResource(ManifestEntry):
         return self.serialize(self.name, self.target)
 
     def rebase(self, base):
+        #print self.target
         u = urlparse(self.target)
-        if u.scheme and u.scheme != 'jar':
+        #print u, dir(u)
+        if u[0] and u[0] != 'jar':
             return ManifestEntry.rebase(self, base)
         clone = ManifestEntry.rebase(self, base)
         clone.target = mozpack.path.rebase(self.base, base, self.target)
@@ -351,12 +353,14 @@ def parse_manifest(root, path, fileobj=N
     linenum = 0
     for line in fileobj:
         linenum += 1
-        with errors.context(path, linenum):
+        errors.context(path, linenum)
+        if 1:
             e = parse_manifest_line(base, line)
             if e:
                 yield e
 
 
+        #errors.context(path, linenum).__exit__(0, 0, 0)
 def is_manifest(path):
     '''
     Return whether the given path is that of a manifest file.
diff -up mozilla-esr31/python/mozbuild/mozpack/copier.py.python3 mozilla-esr31/python/mozbuild/mozpack/copier.py
--- mozilla-esr31/python/mozbuild/mozpack/copier.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/copier.py	2014-09-05 15:26:14.093681114 +0200
@@ -12,11 +12,12 @@ from mozpack.files import (
 )
 import mozpack.path
 import errno
-from collections import (
-    Counter,
-    OrderedDict,
+from mycollections import (
+    namedtuple
 )
+from Counter import Counter
 
+from ordereddict import OrderedDict
 
 class FileRegistry(object):
     '''
@@ -50,10 +51,13 @@ class FileRegistry(object):
         '''
         Add a BaseFile instance to the container, under the given path.
         '''
-        assert isinstance(content, BaseFile)
+        assert isinstance(content, BaseFile)           
         if path in self._files:
             return errors.error("%s already added" % path)
-        if self._required_directories[path] > 0:
+        #print ("REQUIRED_DIRS")
+        #print(self._required_directories)
+        #print ("PATH IS "+ path)
+        if self._required_directories.has_key(path) and self._required_directories[path] > 0:
             return errors.error("Can't add %s: it is a required directory" %
                                 path)
         # Check whether any parent of the given path is already stored
@@ -221,7 +225,7 @@ class FileCopier(FileRegistry):
         # manage children of destination, not its parents.
         try:
             os.makedirs(destination)
-        except OSError as e:
+        except OSError, e:
             if e.errno != errno.EEXIST:
                 raise
 
@@ -256,7 +260,7 @@ class FileCopier(FileRegistry):
         for d in sorted(required_dirs, key=len):
             try:
                 os.mkdir(d)
-            except OSError as error:
+            except OSError, error:
                 if error.errno != errno.EEXIST:
                     raise
 
@@ -468,11 +472,14 @@ class Jarrer(FileRegistry, BaseFile):
             old_jar = JarReader(fileobj=dest)
         except Exception:
             old_jar = []
-
+        #print "old jar", old_jar
+        #for f in old_jar:
+        #  print f.filename, f
         old_contents = dict([(f.filename, f) for f in old_jar])
-
-        with JarWriter(fileobj=dest, compress=self.compress,
-                       optimize=self.optimize) as jar:
+        #print "Old content", old_contents
+        #print "JarWriter"
+        jar = JarWriter(fileobj=dest, compress=self.compress, optimize=self.optimize).__enter__()
+        if 1:
             for path, file in self:
                 if path in old_contents:
                     deflater = DeflaterDest(old_contents[path], self.compress)
@@ -483,6 +490,7 @@ class Jarrer(FileRegistry, BaseFile):
             if self._preload:
                 jar.preload(self._preload)
 
+        jar.__exit__(0, 0, 0)
     def open(self):
         raise RuntimeError('unsupported')
 
diff -up mozilla-esr31/python/mozbuild/mozpack/errors.py.python3 mozilla-esr31/python/mozbuild/mozpack/errors.py
--- mozilla-esr31/python/mozbuild/mozpack/errors.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/errors.py	2014-09-05 15:26:14.093681114 +0200
@@ -3,7 +3,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import sys
-from contextlib import contextmanager
+
 
 
 class ErrorMessage(Exception):
@@ -38,30 +38,40 @@ class ErrorCollector(object):
     information when a context is provided. Context is defined by a pair
     (filename, linenumber), and may be set with errors.context() used as a
     context manager:
-        with errors.context(filename, linenumber):
+        errors.context(filename, linenumber).__enter__()
+        if 1:
             errors.warn(message)
 
+        errors.context(filename, linenumber).__exit__(0, 0, 0)
     Arbitrary nesting is supported, both for errors.context calls:
-        with errors.context(filename1, linenumber1):
+        errors.context(filename1, linenumber1).__enter__()
+        if 1:
             errors.warn(message)
-            with errors.context(filename2, linenumber2):
+            errors.context(filename2, linenumber2).__enter__()
+            if 1:
                 errors.warn(message)
 
+            errors.context(filename2, linenumber2).__exit__(0, 0, 0)
+        errors.context(filename1, linenumber1).__exit__(0, 0, 0)
     as well as for function calls:
         def func():
             errors.warn(message)
-        with errors.context(filename, linenumber):
+        errors.context(filename, linenumber).__enter__()
+        if 1:
             func()
 
+        errors.context(filename, linenumber).__exit__(0, 0, 0)
     Errors and fatal errors can have their exception thrown at a later time,
     allowing for several different errors to be reported at once before
     throwing. This is achieved with errors.accumulate() as a context manager:
-        with errors.accumulate():
+        errors.accumulate().__enter__()
+        if 1:
             if test1:
                 errors.error(message1)
             if test2:
                 errors.error(message2)
 
+        errors.accumulate().__exit__(0, 0, 0)
     In such cases, a single AccumulatedErrors exception is thrown, but doesn't
     contain information about the exceptions. The logged messages do.
     '''
@@ -110,19 +120,19 @@ class ErrorCollector(object):
         if self._context:
             return self._context[-1]
 
-    @contextmanager
+    #@contextmanager
     def context(self, file, line):
         if file and line:
             self._context.append((file, line))
-        yield
+        # just for now yield
         if file and line:
             self._context.pop()
 
-    @contextmanager
+    #@contextmanager
     def accumulate(self):
         assert self._count is None
         self._count = 0
-        yield
+        #just for now yield
         count = self._count
         self._count = None
         if count:
@@ -131,7 +141,10 @@ class ErrorCollector(object):
     @property
     def count(self):
         # _count can be None.
-        return self._count if self._count else 0
+        if self._count:
+          return self._count
+        else:
+          return 0
 
 
 errors = ErrorCollector()
diff -up mozilla-esr31/python/mozbuild/mozpack/executables.py.python3 mozilla-esr31/python/mozbuild/mozpack/executables.py
--- mozilla-esr31/python/mozbuild/mozpack/executables.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/executables.py	2014-09-05 15:26:14.093681114 +0200
@@ -27,7 +27,8 @@ def get_type(path):
     Check the signature of the give file and returns what kind of executable
     matches.
     '''
-    with open(path, 'rb') as f:
+    f = open(path, 'rb')
+    if 1:
         signature = f.read(4)
         if len(signature) < 4:
             return UNKNOWN
@@ -54,6 +55,7 @@ def get_type(path):
         return UNKNOWN
 
 
+    f.close()
 def is_executable(path):
     '''
     Return whether a given file path points to an executable or a library,
@@ -92,7 +94,11 @@ def strip(path):
     '''
     from buildconfig import substs
     strip = substs['STRIP']
-    flags = substs['STRIP_FLAGS'].split() if 'STRIP_FLAGS' in substs else []
+    flags = None
+    if 'STRIP_FLAGS' in substs:
+      flags = substs['STRIP_FLAGS'].split()
+    else:
+      flags = []
     cmd = [strip] + flags + [path]
     if subprocess.call(cmd) != 0:
         errors.fatal('Error executing ' + ' '.join(cmd))
diff -up mozilla-esr31/python/mozbuild/mozpack/files.py.python3 mozilla-esr31/python/mozbuild/mozpack/files.py
--- mozilla-esr31/python/mozbuild/mozpack/files.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/files.py	2014-09-05 15:26:14.094681119 +0200
@@ -20,14 +20,14 @@ from mozpack.executables import (
     elfhack,
 )
 from mozpack.chrome.manifest import ManifestEntry
-from io import BytesIO
+from StringIO import StringIO as BytesIO
 from mozpack.errors import (
     ErrorMessage,
     errors,
 )
 from mozpack.mozjar import JarReader
 import mozpack.path
-from collections import OrderedDict
+from ordereddict import OrderedDict 
 from jsmin import JavascriptMinify
 from tempfile import (
     mkstemp,
@@ -215,8 +215,10 @@ class ExecutableFile(File):
             return False
         try:
             if may_strip(dest):
+                #print "strip", dest
                 strip(dest)
             if may_elfhack(dest):
+                #print "elfhack", dest
                 elfhack(dest)
         except ErrorMessage:
             os.remove(dest)
@@ -263,7 +265,7 @@ class AbsoluteSymlinkFile(File):
 
         try:
             st = os.lstat(dest)
-        except OSError as ose:
+        except OSError, ose:
             if ose.errno != errno.ENOENT:
                 raise
 
@@ -394,11 +396,13 @@ class PreprocessedFile(BaseFile):
         # dependencies from that file to our list.
         if self.depfile and os.path.exists(self.depfile):
             target = mozpack.path.normpath(dest.name)
-            with open(self.depfile, 'rb') as fileobj:
+            fileobj = open(self.depfile, 'rb')
+            if 1:
                 for rule in makeutil.read_dep_makefile(fileobj):
                     if target in rule.targets():
                         pp_deps.update(rule.dependencies())
 
+            fileobj.close()
         skip = False
         if dest.exists() and skip_if_older:
             # If a dependency file was specified, and it doesn't exist,
@@ -417,9 +421,11 @@ class PreprocessedFile(BaseFile):
             deps_out = FileAvoidWrite(self.depfile)
         pp = Preprocessor(defines=self.defines, marker=self.marker)
 
-        with open(self.path, 'rU') as input:
+        input = open(self.path, 'rU')
+        if 1:
             pp.processFile(input=input, output=dest, depfile=deps_out)
 
+        input.close()
         dest.close()
         if self.depfile:
             deps_out.close()
@@ -541,7 +547,11 @@ class ManifestFile(BaseFile):
         currently but could in the future.
     '''
     def __init__(self, base, entries=None):
-        self._entries = entries if entries else []
+        self._entries = None
+        if entries:
+          self._entries = entries
+        else:
+          self._entries = []
         self._base = base
 
     def add(self, entry):
@@ -619,7 +629,10 @@ class MinifiedJavaScript(BaseFile):
         input_source = self._file.open().read()
         output_source = output.getvalue()
 
-        with NamedTemporaryFile() as fh1, NamedTemporaryFile() as fh2:
+        fh1 = NamedTemporaryFile().__enter__()
+        fh2 = NamedTemporaryFile().__enter__()
+        if 1:
+        #with NamedTemporaryFile() as fh1, NamedTemporaryFile() as fh2:
             fh1.write(input_source)
             fh2.write(output_source)
             fh1.flush()
@@ -629,7 +642,7 @@ class MinifiedJavaScript(BaseFile):
                 args = list(self._verify_command)
                 args.extend([fh1.name, fh2.name])
                 subprocess.check_output(args, stderr=subprocess.STDOUT)
-            except subprocess.CalledProcessError as e:
+            except subprocess.CalledProcessError, e:
                 errors.warn('JS minification verification failed for %s:' %
                     (getattr(self._file, 'path', '<unknown>')))
                 # Prefix each line with "Warning:" so mozharness doesn't
@@ -638,6 +651,8 @@ class MinifiedJavaScript(BaseFile):
                     errors.warn(line)
 
                 return self._file.open()
+            fh1.close()
+            fh2.close()
 
         return output
 
@@ -685,9 +700,10 @@ class BaseFinder(object):
         '''
         Iterates over all files under the base directory (excluding files
         starting with a '.' and files at any level under a directory starting
-        with a '.').
-            for path, file in finder:
+        a '.'). for path, file in finder.__enter__()
+        if 1:
                 ...
+        a '.'). for path, file in finder.__exit__(0, 0, 0)
         '''
         return self.find('')
 
diff -up mozilla-esr31/python/mozbuild/mozpack/manifests.py.python3 mozilla-esr31/python/mozbuild/mozpack/manifests.py
--- mozilla-esr31/python/mozbuild/mozpack/manifests.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/manifests.py	2014-09-05 15:26:14.094681119 +0200
@@ -2,12 +2,12 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
 
-from contextlib import contextmanager
-import json
 
-from .files import (
+
+import simplejson as json
+
+from files import (
     AbsoluteSymlinkFile,
     ExistingFile,
     File,
@@ -15,7 +15,7 @@ from .files import (
     PreprocessedFile,
 )
 import mozpack.path as mozpath
-
+from contextdecorator import contextmanager
 
 # This probably belongs in a more generic module. Where?
 @contextmanager
@@ -29,11 +29,10 @@ def _auto_fileobj(path, fileobj, mode='r
     if path:
         fileobj = open(path, mode)
 
-    try:
-        yield fileobj
-    finally:
-        if path:
-            fileobj.close()
+    #try:
+    yield fileobj
+    if path:
+        fileobj.close()
 
 
 class UnreadableInstallManifest(Exception):
@@ -108,10 +107,13 @@ class InstallManifest(object):
         self._source_file = None
 
         if path or fileobj:
-            with _auto_fileobj(path, fileobj, 'rb') as fh:
+            fh = _auto_fileobj(path, fileobj, 'rb').__enter__()
+            if 1:
                 self._source_file = fh.name
                 self._load_from_fileobj(fh)
 
+            #fh.__exit__(0, 0, 0)
+            #fh.close()
     def _load_from_fileobj(self, fileobj):
         version = fileobj.readline().rstrip()
         if version not in ('1', '2', '3', '4'):
@@ -209,7 +211,8 @@ class InstallManifest(object):
 
         It is an error if both are specified.
         """
-        with _auto_fileobj(path, fileobj, 'wb') as fh:
+        fh = _auto_fileobj(path, fileobj, 'wb').__enter__()
+        if 1:
             fh.write('%d\n' % self.CURRENT_VERSION)
 
             for dest in sorted(self._dests):
@@ -220,6 +223,7 @@ class InstallManifest(object):
                 fh.write('%s\n' % self.FIELD_SEPARATOR.join(
                     p.encode('utf-8') for p in parts))
 
+        #fh.close()
     def add_symlink(self, source, dest):
         """Add a symlink to this manifest.
 
@@ -289,7 +293,10 @@ class InstallManifest(object):
         self._dests[dest] = entry
 
     def _get_deps(self, dest):
-        return {self._source_file} if self._source_file else set()
+        if self._source_file:
+            return (self._source_file)
+        else:
+            return set()
 
     def populate_registry(self, registry):
         """Populate a mozpack.copier.FileRegistry instance with data from us.
diff -up mozilla-esr31/python/mozbuild/mozpack/mozjar.py.python3 mozilla-esr31/python/mozbuild/mozpack/mozjar.py
--- mozilla-esr31/python/mozbuild/mozpack/mozjar.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/mozjar.py	2014-09-05 15:26:14.094681119 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from io import BytesIO
+from StringIO import StringIO as BytesIO
 import struct
 import zlib
 import os
@@ -10,8 +10,9 @@ from zipfile import (
     ZIP_STORED,
     ZIP_DEFLATED,
 )
-from collections import OrderedDict
-from urlparse import urlparse, ParseResult
+from ordereddict import OrderedDict
+from urlparse import urlparse
+# ParseResult
 import mozpack.path
 
 JAR_STORED = ZIP_STORED
@@ -94,8 +95,6 @@ class JarStruct(object):
             else:
                 size = sizes[t]
                 value = data[offset:offset + size]
-                if isinstance(value, memoryview):
-                    value = value.tobytes()
             if not name in sizes:
                 self._values[name] = value
             else:
@@ -110,7 +109,11 @@ class JarStruct(object):
         for name, t in self.STRUCT.iteritems():
             if name in self.size_fields:
                 continue
-            self._values[name] = 0 if t in JarStruct.TYPE_MAPPING else ''
+            self._values[name] = None
+            if t in JarStruct.TYPE_MAPPING:
+              self._values[name] = 0
+            else:
+              self._values[name] = ''
 
     @staticmethod
     def get_data(type, data):
@@ -122,8 +125,6 @@ class JarStruct(object):
         assert data is not None
         format, size = JarStruct.TYPE_MAPPING[type]
         data = data[:size]
-        if isinstance(data, memoryview):
-            data = data.tobytes()
         return struct.unpack('<' + format, data)[0], size
 
     def serialize(self):
@@ -261,12 +262,12 @@ class JarFileReader(object):
         the file data.
         '''
         assert header['compression'] in [JAR_DEFLATED, JAR_STORED]
-        self._data = data
         # Copy some local file header fields.
         for name in ['filename', 'compressed_size',
                      'uncompressed_size', 'crc32']:
             setattr(self, name, header[name])
         self.compressed = header['compression'] == JAR_DEFLATED
+        self._data = data[:header['compressed_size']]
 
     def read(self, length=-1):
         '''
@@ -287,7 +288,7 @@ class JarFileReader(object):
         '''
         return iter(self.readlines())
 
-    def seek(self, pos, whence=os.SEEK_SET):
+    def seek(self, pos, whence=0):
         '''
         Change the current position in the uncompressed data. Subsequent reads
         will start from there.
@@ -316,9 +317,7 @@ class JarFileReader(object):
             return self._uncompressed_data
         data = self.compressed_data
         if self.compressed:
-            data = zlib.decompress(data.tobytes(), -MAX_WBITS)
-        else:
-            data = data.tobytes()
+            data = zlib.decompress(data, -MAX_WBITS)
         if len(data) != self.uncompressed_size:
             raise JarReaderError('Corrupted file? %s' % self.filename)
         self._uncompressed_data = BytesIO(data)
@@ -339,7 +338,7 @@ class JarReader(object):
             data = fileobj.read()
         else:
             data = open(file, 'rb').read()
-        self._data = memoryview(data)
+        self._data = buffer(data)
         # The End of Central Directory Record has a variable size because of
         # comments it may contain, so scan for it from the end of the file.
         offset = -CDIR_END_SIZE
@@ -666,8 +665,6 @@ class Deflater(object):
         self._data.write(data)
         if self.compress:
             if self._deflater:
-                if isinstance(data, memoryview):
-                    data = data.tobytes()
                 self._deflated.write(self._deflater.compress(data))
             else:
                 raise JarWriterError("Can't write after flush")
@@ -780,6 +777,7 @@ class JarLog(dict):
         - jar:jar:file:///{path}!/{subpath}!/{subpath2} becomes
            ({path}, {subpath}, {subpath2})
         '''
+        #print url, dir(url)
         if not isinstance(url, ParseResult):
             # Assume that if it doesn't start with jar: or file:, it's a path.
             if not url.startswith(('jar:', 'file:')):
diff -up mozilla-esr31/python/mozbuild/mozpack/packager/formats.py.python3 mozilla-esr31/python/mozbuild/mozpack/packager/formats.py
--- mozilla-esr31/python/mozbuild/mozpack/packager/formats.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/packager/formats.py	2014-09-05 15:26:14.094681119 +0200
@@ -2,6 +2,8 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from rhrebase import all, any
+
 from mozpack.chrome.manifest import (
     Manifest,
     ManifestInterfaces,
@@ -100,8 +102,7 @@ class FlatFormatter(object):
                                                        '%s.manifest' % name))
         if not self.copier.contains(path):
             assert mozpack.path.basedir(entry.base, [base]) == base
-            # Add a reference to the manifest file in the parent manifest, if
-            # the manifest file is not a root manifest.
+            # Add a reference to the manifest file in the parent manifest, if # the manifest file is not a root manifest.
             if len(entry.base) > len(base):
                 parent = mozpack.path.dirname(entry.base)
                 relbase = mozpack.path.basename(entry.base)
diff -up mozilla-esr31/python/mozbuild/mozpack/packager/__init__.py.python3 mozilla-esr31/python/mozbuild/mozpack/packager/__init__.py
--- mozilla-esr31/python/mozbuild/mozpack/packager/__init__.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/packager/__init__.py	2014-09-05 15:26:14.094681119 +0200
@@ -99,7 +99,11 @@ class Component(object):
             raise ValueError('No component found')
         if not re.match('[a-zA-Z0-9_\-]+$', component):
             raise ValueError('Bad component name ' + component)
-        options = Component._split_options(splits[1]) if len(splits) > 1 else {}
+        options = None
+        if len(splits) > 1:
+          options = Component._split_options(splits[1])
+        else:
+          options = {}
         return component, options
 
     @staticmethod
@@ -109,7 +113,7 @@ class Component(object):
         '''
         try:
             name, options = Component._split_component_and_options(string)
-        except ValueError as e:
+        except ValueError, e:
             errors.fatal('Malformed manifest: %s' % e)
             return
         destdir = options.pop('destdir', '')
@@ -174,10 +178,12 @@ class PreprocessorOutputWrapper(object):
 
     def write(self, str):
         file = os.path.normpath(os.path.abspath(self._pp.context['FILE']))
-        with errors.context(file, self._pp.context['LINE']):
+        errors.context(file, self._pp.context['LINE'])
+        if 1:
             self._parser.handle_line(str)
 
 
+        #errors.context(file, self._pp.context['LINE']).__exit__(0, 0, 0)
 def preprocess(input, parser, defines={}):
     '''
     Preprocess the file-like input with the given defines, and send the
@@ -213,8 +219,10 @@ class CallDeque(deque):
             except IndexError:
                 return
             if context:
-                with errors.context(context[0], context[1]):
+                errors.context(context[0], context[1]).__enter__()
+                if 1:
                     function(*args)
+                errors.context(context[0], context[1]).__exit__(0, 0, 0)
             else:
                 function(*args)
 
diff -up mozilla-esr31/python/mozbuild/mozpack/packager/l10n.py.python3 mozilla-esr31/python/mozbuild/mozpack/packager/l10n.py
--- mozilla-esr31/python/mozbuild/mozpack/packager/l10n.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/packager/l10n.py	2014-09-05 15:26:14.094681119 +0200
@@ -168,7 +168,9 @@ def repack(source, l10n, non_resources=[
                                      optimize=app_finder.optimizedjars,
                                      non_resources=non_resources)
 
-    with errors.accumulate():
+    errors.accumulate().__enter__()
+    if 1:
         _repack(app_finder, l10n_finder, copier, formatter, non_chrome)
+    errors.accumulate().__exit__(0, 0, 0)
     copier.copy(source, skip_if_older=False)
     generate_precomplete(source)
diff -up mozilla-esr31/python/mozbuild/mozpack/packager/unpack.py.python3 mozilla-esr31/python/mozbuild/mozpack/packager/unpack.py
--- mozilla-esr31/python/mozbuild/mozpack/packager/unpack.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/packager/unpack.py	2014-09-05 15:26:14.095681124 +0200
@@ -68,8 +68,11 @@ class UnpackFinder(FileFinder):
             # jar: urls. If there are some, the files contained in the jar they
             # point to, go under a directory named after the jar.
             if is_manifest(p):
-                m = self.files[p] if self.files.contains(p) \
-                    else ManifestFile(base)
+                m = None
+                if self.files.contains(p):
+                  m = self.files[p]
+                else:
+                  m = ManifestFile(base)
                 for e in parse_manifest(self.base, p, f.open()):
                     m.add(self._handle_manifest_entry(e, jars))
                 if self.files.contains(p):
@@ -82,8 +85,11 @@ class UnpackFinder(FileFinder):
         for j in jar:
             path = mozpack.path.join(base, j.filename)
             if is_manifest(j.filename):
-                m = self.files[path] if self.files.contains(path) \
-                    else ManifestFile(mozpack.path.dirname(path))
+                m = None
+                if self.files.contains(path):
+                  m = self.files[path]
+                else:
+                  m = ManifestFile(mozpack.path.dirname(path))
                 for e in parse_manifest(None, path, j):
                     m.add(e)
                 if not self.files.contains(path):
@@ -95,10 +101,10 @@ class UnpackFinder(FileFinder):
     def _handle_manifest_entry(self, entry, jars):
         jarpath = None
         if isinstance(entry, ManifestEntryWithRelPath) and \
-                urlparse(entry.relpath).scheme == 'jar':
+                urlparse(entry.relpath)[0] == 'jar':
             jarpath, entry = self._unjarize(entry, entry.relpath)
         elif isinstance(entry, ManifestResource) and \
-                urlparse(entry.target).scheme == 'jar':
+                urlparse(entry.target)[0] == 'jar':
             jarpath, entry = self._unjarize(entry, entry.target)
         if jarpath:
             # Don't defer unpacking the jar file. If we already saw
@@ -153,7 +159,7 @@ class UnpackFinder(FileFinder):
         the new entry.
         '''
         base = entry.base
-        jar, relpath = urlparse(relpath).path.split('!', 1)
+        jar, relpath = urlparse(relpath)[1].split('!', 1)
         entry = entry.rebase(mozpack.path.join(base, 'jar:%s!' % jar)) \
             .move(mozpack.path.join(base, mozpack.path.splitext(jar)[0])) \
             .rebase(base)
diff -up mozilla-esr31/python/mozbuild/mozpack/path.py.python3 mozilla-esr31/python/mozbuild/mozpack/path.py
--- mozilla-esr31/python/mozbuild/mozpack/path.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/path.py	2014-09-05 15:26:14.095681124 +0200
@@ -1,6 +1,60 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# relpath
+import os, sys
+# Creates os.path.relpath for Python 2.4
+
+if not hasattr(os, "relpath"):
+    if os.path is sys.modules.get("ntpath"):
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+            if start_list[0].lower() != path_list[0].lower():
+                unc_path, rest = os.path.splitunc(path)
+                unc_start, rest = os.path.splitunc(start)
+                if bool(unc_path) ^ bool(unc_start):
+                    raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+                                                                        % (path, start))
+                else:
+                    raise ValueError("path is on drive %s, start on drive %s"
+                                                        % (path_list[0], start_list[0]))
+            # Work out how much of the filepath is shared by start and path.
+            for i in range(min(len(start_list), len(path_list))):
+                if start_list[i].lower() != path_list[i].lower():
+                    break
+            else:
+                i += 1
+ 
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+    
+    else:
+        # default to posixpath definition
+        def relpath(path, start=os.path.curdir):
+            """Return a relative version of a path"""
+        
+            if not path:
+                raise ValueError("no path specified")
+        
+            start_list = os.path.abspath(start).split(os.path.sep)
+            path_list = os.path.abspath(path).split(os.path.sep)
+        
+            # Work out how much of the filepath is shared by start and path.
+            i = len(os.path.commonprefix([start_list, path_list]))
+        
+            rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+            if not rel_list:
+                return os.path.curdir
+            return os.path.join(*rel_list)
+        
+    os.path.relpath = relpath
 
 import posixpath
 import os
@@ -25,7 +79,10 @@ def normsep(path):
 
 def relpath(path, start):
     rel = normsep(os.path.relpath(path, start))
-    return '' if rel == '.' else rel
+    if rel == '.':
+      return ''
+    else:
+      return rel
 
 
 def abspath(path):
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_chrome_manifest.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_chrome_manifest.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_chrome_manifest.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_chrome_manifest.py	2014-09-05 15:26:14.095681124 +0200
@@ -131,7 +131,8 @@ class TestManifestErrors(TestErrors, uni
             'binary-component bar.so',
             'unsupported foo',
         ]
-        with mozunit.MockedOpen({'manifest': '\n'.join(manifest)}):
+        mozunit.MockedOpen({'manifest': '\n'.join(manifest)}).__enter__()
+        if 1:
             with self.assertRaises(AccumulatedErrors):
                 with errors.accumulate():
                     list(parse_manifest(os.curdir, 'manifest'))
@@ -145,5 +146,6 @@ class TestManifestErrors(TestErrors, uni
             self.assertTrue(out[1].startswith('Error: %s:4: ' % path))
 
 
+        mozunit.MockedOpen({'manifest': '\n'.join(manifest)}).__exit__(0, 0, 0)
 if __name__ == '__main__':
     mozunit.main()
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_copier.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_copier.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_copier.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_copier.py	2014-09-05 15:26:14.095681124 +0200
@@ -290,13 +290,17 @@ class TestFileCopier(TestWithTmpDir):
 
     def test_permissions(self):
         """Ensure files without write permission can be deleted."""
-        with open(self.tmppath('dummy'), 'a'):
+        open(self.tmppath('dummy'), 'a').__enter__()
+        if 1:
             pass
 
+        open(self.tmppath('dummy'), 'a').__exit__(0, 0, 0)
         p = self.tmppath('no_perms')
-        with open(p, 'a'):
+        open(p, 'a').__enter__()
+        if 1:
             pass
 
+        open(p, 'a').__exit__(0, 0, 0)
         # Make file and directory unwritable. Reminder: making a directory
         # unwritable prevents modifications (including deletes) from the list
         # of files in that directory.
@@ -313,16 +317,20 @@ class TestFileCopier(TestWithTmpDir):
         copier = FileCopier()
         copier.add('foo', GeneratedFile('foo'))
 
-        with open(self.tmppath('bar'), 'a'):
+        open(self.tmppath('bar'), 'a').__enter__()
+        if 1:
             pass
 
+        open(self.tmppath('bar'), 'a').__exit__(0, 0, 0)
         os.mkdir(self.tmppath('emptydir'))
         d = self.tmppath('populateddir')
         os.mkdir(d)
 
-        with open(self.tmppath('populateddir/foo'), 'a'):
+        open(self.tmppath('populateddir/foo'), 'a').__enter__()
+        if 1:
             pass
 
+        open(self.tmppath('populateddir/foo'), 'a').__exit__(0, 0, 0)
         result = copier.copy(self.tmpdir, remove_unaccounted=False)
 
         self.assertEqual(self.all_files(self.tmpdir), set(['foo', 'bar',
@@ -336,16 +344,20 @@ class TestFileCopier(TestWithTmpDir):
         copier = FileCopier()
         copier.add('foo', GeneratedFile('foo'))
 
-        with open(self.tmppath('bar'), 'a'):
+        open(self.tmppath('bar'), 'a').__enter__()
+        if 1:
             pass
 
+        open(self.tmppath('bar'), 'a').__exit__(0, 0, 0)
         os.mkdir(self.tmppath('emptydir'))
         d = self.tmppath('populateddir')
         os.mkdir(d)
 
-        with open(self.tmppath('populateddir/foo'), 'a'):
+        open(self.tmppath('populateddir/foo'), 'a').__enter__()
+        if 1:
             pass
 
+        open(self.tmppath('populateddir/foo'), 'a').__exit__(0, 0, 0)
         result = copier.copy(self.tmpdir, remove_unaccounted=False,
             remove_empty_directories=False)
 
@@ -390,16 +402,22 @@ class TestFilePurger(TestWithTmpDir):
         extra = os.path.join(self.tmpdir, 'extra')
         empty_dir = os.path.join(self.tmpdir, 'dir')
 
-        with open(existing, 'a'):
+        open(existing, 'a').__enter__()
+        if 1:
             pass
 
-        with open(extra, 'a'):
+        open(existing, 'a').__exit__(0, 0, 0)
+        open(extra, 'a').__enter__()
+        if 1:
             pass
 
+        open(extra, 'a').__exit__(0, 0, 0)
         os.mkdir(empty_dir)
-        with open(os.path.join(empty_dir, 'foo'), 'a'):
+        open(os.path.join(empty_dir, 'foo'), 'a').__enter__()
+        if 1:
             pass
 
+        open(os.path.join(empty_dir, 'foo'), 'a').__exit__(0, 0, 0)
         self.assertTrue(os.path.exists(existing))
         self.assertTrue(os.path.exists(extra))
 
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_errors.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_errors.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_errors.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_errors.py	2014-09-05 15:26:14.095681124 +0200
@@ -40,25 +40,32 @@ class TestErrorsImpl(TestErrors, unittes
         self.assertEquals(self.get_output(), ['Warning: foo', 'Warning: bar'])
 
     def test_no_error(self):
-        with errors.accumulate():
+        errors.accumulate().__enter__()
+        if 1:
             errors.warn('1')
 
+        errors.accumulate().__exit__(0, 0, 0)
     def test_simple_error(self):
-        with self.assertRaises(AccumulatedErrors):
+        self.assertRaises(AccumulatedErrors).__enter__()
+        if 1:
             with errors.accumulate():
                 errors.error('1')
+        self.assertRaises(AccumulatedErrors).__exit__(0, 0, 0)
         self.assertEquals(self.get_output(), ['Error: 1'])
 
     def test_error_loop(self):
-        with self.assertRaises(AccumulatedErrors):
+        self.assertRaises(AccumulatedErrors).__enter__()
+        if 1:
             with errors.accumulate():
                 for i in range(3):
                     errors.error('%d' % i)
+        self.assertRaises(AccumulatedErrors).__exit__(0, 0, 0)
         self.assertEquals(self.get_output(),
                           ['Error: 0', 'Error: 1', 'Error: 2'])
 
     def test_multiple_errors(self):
-        with self.assertRaises(AccumulatedErrors):
+        self.assertRaises(AccumulatedErrors).__enter__()
+        if 1:
             with errors.accumulate():
                 errors.error('foo')
                 for i in range(3):
@@ -67,12 +74,14 @@ class TestErrorsImpl(TestErrors, unittes
                     else:
                         errors.error('%d' % i)
                 errors.error('bar')
+        self.assertRaises(AccumulatedErrors).__exit__(0, 0, 0)
         self.assertEquals(self.get_output(),
                           ['Error: foo', 'Error: 0', 'Error: 1',
                            'Warning: 2', 'Error: bar'])
 
     def test_errors_context(self):
-        with self.assertRaises(AccumulatedErrors):
+        self.assertRaises(AccumulatedErrors).__enter__()
+        if 1:
             with errors.accumulate():
                 self.assertEqual(errors.get_context(), None)
                 with errors.context('foo', 1):
@@ -83,6 +92,7 @@ class TestErrorsImpl(TestErrors, unittes
                         errors.error('b')
                     self.assertEqual(errors.get_context(), ('foo', 1))
                     errors.error('c')
+        self.assertRaises(AccumulatedErrors).__exit__(0, 0, 0)
         self.assertEqual(self.get_output(), [
             'Error: foo:1: a',
             'Error: bar:2: b',
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_files.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_files.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_files.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_files.py	2014-09-05 15:26:14.095681124 +0200
@@ -53,9 +53,11 @@ class TestWithTmpDir(unittest.TestCase):
             return
 
         dummy_path = self.tmppath('dummy_file')
-        with open(dummy_path, 'a'):
+        open(dummy_path, 'a').__enter__()
+        if 1:
             pass
 
+        open(dummy_path, 'a').__exit__(0, 0, 0)
         try:
             os.symlink(dummy_path, self.tmppath('dummy_symlink'))
             os.remove(self.tmppath('dummy_symlink'))
@@ -153,8 +155,10 @@ class TestFile(TestWithTmpDir):
         dest = self.tmppath('dest')
 
         for content in samples:
-            with open(src, 'wb') as tmp:
+            tmp = open(src, 'wb')
+            if 1:
                 tmp.write(content)
+            tmp.__exit__(0, 0, 0)
             # Ensure the destination file, when it exists, is older than the
             # source
             if os.path.exists(dest):
@@ -177,8 +181,10 @@ class TestFile(TestWithTmpDir):
         dest = MockDest()
 
         for content in samples:
-            with open(src, 'wb') as tmp:
+            tmp = open(src, 'wb').__enter__()
+            if 1:
                 tmp.write(content)
+            tmp.close()
             f = File(src)
             f.copy(dest)
             self.assertEqual(content, dest.getvalue())
@@ -189,9 +195,11 @@ class TestFile(TestWithTmpDir):
         '''
         src = self.tmppath('src')
         content = ''.join(samples)
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb')
+        if 1:
             tmp.write(content)
 
+        tmp.__exit__(0, 0, 0)
         f = File(src)
         self.assertEqual(content[:42], f.open().read(42))
         self.assertEqual(content, f.open().read())
@@ -204,9 +212,11 @@ class TestFile(TestWithTmpDir):
         src = self.tmppath('src')
         dest = self.tmppath('dest')
 
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb')
+        if 1:
             tmp.write('test')
 
+        tmp.__exit__(0, 0, 0)
         # Initial copy
         f = File(src)
         f.copy(dest)
@@ -224,8 +234,10 @@ class TestFile(TestWithTmpDir):
 
         # When the source file is older than the destination file, even with
         # different content, no copy should occur.
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb').__enter__()
+        if 1:
             tmp.write('fooo')
+        tmp.__exit__(0, 0, 0)
         time = os.path.getmtime(dest) - 1
         os.utime(src, (time, time))
         f.copy(DestNoWrite(dest))
@@ -246,14 +258,18 @@ class TestAbsoluteSymlinkFile(TestWithTm
     def test_absolute_relative(self):
         AbsoluteSymlinkFile('/foo')
 
-        with self.assertRaisesRegexp(ValueError, 'Symlink target not absolute'):
+        self.assertRaisesRegexp(ValueError, 'Symlink target not absolute').__enter__()
+        if 1:
             AbsoluteSymlinkFile('./foo')
 
+        self.assertRaisesRegexp(ValueError, 'Symlink target not absolute').__exit__(0, 0, 0)
     def test_symlink_file(self):
         source = self.tmppath('test_path')
-        with open(source, 'wt') as fh:
+        fh = open(source, 'wt').__enter__()
+        if 1:
             fh.write('Hello world')
 
+        fh.__exit__(0, 0, 0)
         s = AbsoluteSymlinkFile(source)
         dest = self.tmppath('symlink')
         self.assertTrue(s.copy(dest))
@@ -271,13 +287,17 @@ class TestAbsoluteSymlinkFile(TestWithTm
         # If symlinks are supported, an existing file should be replaced by a
         # symlink.
         source = self.tmppath('test_path')
-        with open(source, 'wt') as fh:
+        fh = open(source, 'wt').__enter__()
+        if 1:
             fh.write('source')
 
+        fh.__exit__(0, 0, 0)
         dest = self.tmppath('dest')
-        with open(dest, 'a'):
+        open(dest, 'a').__enter__()
+        if 1:
             pass
 
+        open(dest, 'a').__exit__(0, 0, 0)
         s = AbsoluteSymlinkFile(source)
         s.copy(dest, skip_if_older=False)
 
@@ -295,9 +315,11 @@ class TestAbsoluteSymlinkFile(TestWithTm
             return
 
         source = self.tmppath('source')
-        with open(source, 'a'):
+        open(source, 'a').__enter__()
+        if 1:
             pass
 
+        open(source, 'a').__exit__(0, 0, 0)
         dest = self.tmppath('dest')
 
         os.symlink(self.tmppath('bad'), dest)
@@ -317,9 +339,11 @@ class TestAbsoluteSymlinkFile(TestWithTm
         source = self.tmppath('source')
         dest = self.tmppath('dest')
 
-        with open(source, 'a'):
+        open(source, 'a').__enter__()
+        if 1:
             pass
 
+        open(source, 'a').__exit__(0, 0, 0)
         os.symlink(source, dest)
         link = os.readlink(dest)
         self.assertEqual(link, source)
@@ -338,9 +362,11 @@ class TestPreprocessedFile(TestWithTmpDi
         src = self.tmppath('src')
         dest = self.tmppath('dest')
 
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb').__enter__()
+        if 1:
             tmp.write('#ifdef FOO\ntest\n#endif')
 
+        tmp.__exit__(0, 0, 0)
         f = PreprocessedFile(src, depfile_path=None, marker='#', defines={'FOO': True})
         self.assertTrue(f.copy(dest))
 
@@ -355,9 +381,11 @@ class TestPreprocessedFile(TestWithTmpDi
         dest = self.tmppath('dest')
         depfile = self.tmppath('depfile')
 
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb').__enter__()
+        if 1:
             tmp.write('#ifdef FOO\ntest\n#endif')
 
+        tmp.__exit__(0, 0, 0)
         # Initial copy
         f = PreprocessedFile(src, depfile_path=depfile, marker='#', defines={'FOO': True})
         self.assertTrue(f.copy(dest))
@@ -368,8 +396,10 @@ class TestPreprocessedFile(TestWithTmpDi
 
         # When the source file is older than the destination file, even with
         # different content, no copy should occur.
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb').__enter__()
+        if 1:
             tmp.write('#ifdef FOO\nfooo\n#endif')
+        tmp.__exit__(0, 0, 0)
         time = os.path.getmtime(dest) - 1
         os.utime(src, (time, time))
         self.assertFalse(f.copy(DestNoWrite(dest)))
@@ -388,19 +418,25 @@ class TestPreprocessedFile(TestWithTmpDi
         incl = self.tmppath('incl')
         deps = self.tmppath('src.pp')
 
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb').__enter__()
+        if 1:
             tmp.write('#ifdef FOO\ntest\n#endif')
 
-        with open(incl, 'wb') as tmp:
+        tmp.__exit__(0, 0, 0)
+        tmp = open(incl, 'wb').__enter__()
+        if 1:
             tmp.write('foo bar')
 
+        tmp.__exit__(0, 0, 0)
         # Initial copy
         f = PreprocessedFile(src, depfile_path=deps, marker='#', defines={'FOO': True})
         self.assertTrue(f.copy(dest))
 
         # Update the source so it #includes the include file.
-        with open(src, 'wb') as tmp:
+        tmp = open(src, 'wb').__enter__()
+        if 1:
             tmp.write('#include incl\n')
+        tmp.__exit__(0, 0, 0)
         time = os.path.getmtime(dest) + 1
         os.utime(src, (time, time))
         self.assertTrue(f.copy(dest))
@@ -409,8 +445,10 @@ class TestPreprocessedFile(TestWithTmpDi
         # If one of the dependencies changes, the file should be updated. The
         # mtime of the dependency is set after the destination file, to avoid
         # both files having the same time.
-        with open(incl, 'wb') as tmp:
+        tmp = open(incl, 'wb').__enter__()
+        if 1:
             tmp.write('quux')
+        tmp.close()
         time = os.path.getmtime(dest) + 1
         os.utime(incl, (time, time))
         self.assertTrue(f.copy(dest))
@@ -436,15 +474,19 @@ class TestPreprocessedFile(TestWithTmpDi
         pp_source = self.tmppath('pp_in')
         deps = self.tmppath('deps')
 
-        with open(source, 'a'):
+        open(source, 'a').__enter__()
+        if 1:
             pass
 
+        open(source, 'a').__exit__(0, 0, 0)
         os.symlink(source, dest)
         self.assertTrue(os.path.islink(dest))
 
-        with open(pp_source, 'wb') as tmp:
+        tmp = open(pp_source, 'wb').__enter__()
+        if 1:
             tmp.write('#define FOO\nPREPROCESSED')
 
+        tmp.close()
         f = PreprocessedFile(pp_source, depfile_path=deps, marker='#',
             defines={'FOO': True})
         self.assertTrue(f.copy(dest))
@@ -455,15 +497,19 @@ class TestPreprocessedFile(TestWithTmpDi
 
 class TestExistingFile(TestWithTmpDir):
     def test_required_missing_dest(self):
-        with self.assertRaisesRegexp(ErrorMessage, 'Required existing file'):
+        self.assertRaisesRegexp(ErrorMessage, 'Required existing file').__enter__()
+        if 1:
             f = ExistingFile(required=True)
             f.copy(self.tmppath('dest'))
 
+        self.assertRaisesRegexp(ErrorMessage, 'Required existing file').__exit__(0, 0, 0)
     def test_required_existing_dest(self):
         p = self.tmppath('dest')
-        with open(p, 'a'):
+        open(p, 'a').__enter__()
+        if 1:
             pass
 
+        open(p, 'a').__exit__(0, 0, 0)
         f = ExistingFile(required=True)
         f.copy(p)
 
@@ -473,9 +519,11 @@ class TestExistingFile(TestWithTmpDir):
 
     def test_optional_existing_dest(self):
         p = self.tmppath('dest')
-        with open(p, 'a'):
+        open(p, 'a').__enter__()
+        if 1:
             pass
 
+        open(p, 'a').__exit__(0, 0, 0)
         f = ExistingFile(required=False)
         f.copy(p)
 
@@ -541,13 +589,15 @@ class TestDeflatedFile(TestWithTmpDir):
         dest = self.tmppath('dest')
 
         contents = {}
-        with JarWriter(src) as jar:
+        jar = JarWriter(src).__enter__()
+        if 1:
             for content in samples:
                 name = ''.join(random.choice(string.letters)
                                for i in xrange(8))
                 jar.add(name, content, compress=True)
                 contents[name] = content
 
+        jar.__exit__(0, 0, 0)
         for j in JarReader(src):
             f = DeflatedFile(j)
             f.copy(dest)
@@ -560,9 +610,11 @@ class TestDeflatedFile(TestWithTmpDir):
         '''
         src = self.tmppath('src.jar')
         content = ''.join(samples)
-        with JarWriter(src) as jar:
+        jar = JarWriter(src).__enter__()
+        if 1:
             jar.add('content', content)
 
+        jar.__exit__(0, 0, 0)
         f = DeflatedFile(JarReader(src)['content'])
         self.assertEqual(content[:42], f.open().read(42))
         self.assertEqual(content, f.open().read())
@@ -575,11 +627,13 @@ class TestDeflatedFile(TestWithTmpDir):
         src = self.tmppath('src.jar')
         dest = self.tmppath('dest')
 
-        with JarWriter(src) as jar:
+        jar = JarWriter(src).__enter__()
+        if 1:
             jar.add('test', 'test')
             jar.add('test2', 'test')
             jar.add('fooo', 'fooo')
 
+        jar.__exit__(0, 0, 0)
         jar = JarReader(src)
         # Initial copy
         f = DeflatedFile(jar['test'])
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_manifests.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_manifests.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_manifests.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_manifests.py	2014-09-05 15:26:14.096681129 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 
@@ -40,27 +40,41 @@ class TestInstallManifest(TestWithTmpDir
         self.assertIn('e_dest', m)
         self.assertIn('o_dest', m)
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_symlink('s_other', 's_dest')
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_copy('c_other', 'c_dest')
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_preprocess('p_other', 'p_dest', 'p_other.pp')
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_required_exists('e_dest')
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_optional_exists('o_dest')
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_pattern_symlink('ps_base', 'ps/*', 'ps_dest')
 
-        with self.assertRaises(ValueError):
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
+        self.assertRaises(ValueError).__enter__()
+        if 1:
             m.add_pattern_copy('pc_base', 'pc/**', 'pc_dest')
 
+        self.assertRaises(ValueError).__exit__(0, 0, 0)
     def _get_test_manifest(self):
         m = InstallManifest()
         m.add_symlink(self.tmppath('s_source'), 's_dest')
@@ -80,9 +94,11 @@ class TestInstallManifest(TestWithTmpDir
         m.write(path=p)
         self.assertTrue(os.path.isfile(p))
 
-        with open(p, 'rb') as fh:
+        fh = open(p, 'rb')
+        if 1:
             c = fh.read()
 
+        fh.__exit__(0, 0, 0)
         self.assertEqual(c.count('\n'), 8)
 
         lines = c.splitlines()
@@ -95,9 +111,11 @@ class TestInstallManifest(TestWithTmpDir
         p2 = self.tmppath('m2')
         m2.write(path=p2)
 
-        with open(p2, 'rb') as fh:
+        fh = open(p2, 'rb').__enter__()
+        if 1:
             c2 = fh.read()
 
+        fh.__exit__(0, 0, 0)
         self.assertEqual(c, c2)
 
     def test_populate_registry(self):
@@ -114,12 +132,16 @@ class TestInstallManifest(TestWithTmpDir
         os.mkdir('%s/base' % source)
         os.mkdir('%s/base/foo' % source)
 
-        with open('%s/base/foo/file1' % source, 'a'):
+        open('%s/base/foo/file1' % source, 'a').__enter__()
+        if 1:
             pass
 
-        with open('%s/base/foo/file2' % source, 'a'):
+        open('%s/base/foo/file1' % source, 'a').__exit__(0, 0, 0)
+        open('%s/base/foo/file2' % source, 'a').__enter__()
+        if 1:
             pass
 
+        open('%s/base/foo/file2' % source, 'a').__exit__(0, 0, 0)
         m = InstallManifest()
         m.add_pattern_symlink('%s/base' % source, '**', 'dest')
 
@@ -147,24 +169,36 @@ class TestInstallManifest(TestWithTmpDir
         os.mkdir(dest)
 
         to_delete = self.tmppath('dest/to_delete')
-        with open(to_delete, 'a'):
+        open(to_delete, 'a').__enter__()
+        if 1:
             pass
 
-        with open(self.tmppath('s_source'), 'wt') as fh:
+        open(to_delete, 'a').__exit__(0, 0, 0)
+        fh = open(self.tmppath('s_source'), 'wt').__enter__()
+        if 1:
             fh.write('symlink!')
 
-        with open(self.tmppath('c_source'), 'wt') as fh:
+        fh.__exit__(0, 0, 0)
+        fh = open(self.tmppath('c_source'), 'wt').__enter__()
+        if 1:
             fh.write('copy!')
 
-        with open(self.tmppath('p_source'), 'wt') as fh:
+        fh.__exit__(0, 0, 0)
+        fh = open(self.tmppath('p_source'), 'wt').__enter__()
+        if 1:
             fh.write('#define FOO 1\npreprocess!')
 
-        with open(self.tmppath('dest/e_dest'), 'a'):
+        fh.__exit__(0, 0, 0)
+        open(self.tmppath('dest/e_dest'), 'a').__enter__()
+        if 1:
             pass
 
-        with open(self.tmppath('dest/o_dest'), 'a'):
+        open(self.tmppath('dest/e_dest'), 'a').__exit__(0, 0, 0)
+        open(self.tmppath('dest/o_dest'), 'a').__enter__()
+        if 1:
             pass
 
+        open(self.tmppath('dest/o_dest'), 'a').__exit__(0, 0, 0)
         m = self._get_test_manifest()
         c = FileCopier()
         m.populate_registry(c)
@@ -177,15 +211,21 @@ class TestInstallManifest(TestWithTmpDir
         self.assertTrue(os.path.exists(self.tmppath('dest/o_dest')))
         self.assertFalse(os.path.exists(to_delete))
 
-        with open(self.tmppath('dest/s_dest'), 'rt') as fh:
+        fh = open(self.tmppath('dest/s_dest'), 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'symlink!')
 
-        with open(self.tmppath('dest/c_dest'), 'rt') as fh:
+        fh.__exit__(0, 0, 0)
+        fh = open(self.tmppath('dest/c_dest'), 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'copy!')
 
-        with open(self.tmppath('dest/p_dest'), 'rt') as fh:
+        fh.__exit__(0, 0, 0)
+        fh = open(self.tmppath('dest/p_dest'), 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'preprocess!')
 
+        fh.__exit__(0, 0, 0)
         self.assertEqual(result.updated_files, set(self.tmppath(p) for p in (
             'dest/s_dest', 'dest/c_dest', 'dest/p_dest')))
         self.assertEqual(result.existing_files,
@@ -199,15 +239,19 @@ class TestInstallManifest(TestWithTmpDir
         dest = self.tmppath('dest')
         include = self.tmppath('p_incl')
 
-        with open(include, 'wt') as fh:
+        fh = open(include, 'wt').__enter__()
+        if 1:
             fh.write('#define INCL\n')
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(include) - 3
         os.utime(include, (time, time))
 
-        with open(self.tmppath('p_source'), 'wt') as fh:
+        fh = open(self.tmppath('p_source'), 'wt').__enter__()
+        if 1:
             fh.write('#ifdef FOO\n#if BAZ == QUX\nPASS1\n#endif\n#endif\n')
             fh.write('#ifdef DEPTEST\nPASS2\n#endif\n')
             fh.write('#include p_incl\n#ifdef INCLTEST\nPASS3\n#endif\n')
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(self.tmppath('p_source')) - 3
         os.utime(self.tmppath('p_source'), (time, time))
 
@@ -224,9 +268,11 @@ class TestInstallManifest(TestWithTmpDir
 
         self.assertTrue(os.path.exists(self.tmppath('dest/p_dest')))
 
-        with open(self.tmppath('dest/p_dest'), 'rt') as fh:
+        fh = open(self.tmppath('dest/p_dest'), 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'PASS1\n')
 
+        fh.__exit__(0, 0, 0)
         # Create a second manifest with the preprocessed file, then apply it.
         # Since this manifest does not exist on the disk, there should not be a
         # dependency on it, and the preprocessed file should not be modified.
@@ -252,9 +298,11 @@ class TestInstallManifest(TestWithTmpDir
         m2.populate_registry(c)
         self.assertTrue(c.copy(dest))
 
-        with open(self.tmppath('dest/p_dest'), 'rt') as fh:
+        fh = open(self.tmppath('dest/p_dest'), 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'PASS2\n')
 
+        fh.__exit__(0, 0, 0)
         # Set the time on the manifest back, so it won't be picked up as
         # modified in the next test
         time = os.path.getmtime(manifest) - 1
@@ -262,18 +310,22 @@ class TestInstallManifest(TestWithTmpDir
 
         # Update the contents of a file included by the source file. This should
         # cause the destination to be regenerated.
-        with open(include, 'wt') as fh:
+        fh = open(include, 'wt').__enter__()
+        if 1:
             fh.write('#define INCLTEST\n')
 
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(include) - 1
         os.utime(self.tmppath('dest/p_dest'), (time, time))
         c = FileCopier()
         m2.populate_registry(c)
         self.assertTrue(c.copy(dest))
 
-        with open(self.tmppath('dest/p_dest'), 'rt') as fh:
+        fh = open(self.tmppath('dest/p_dest'), 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'PASS2\nPASS3\n')
 
+        fh.__exit__(0, 0, 0)
     def test_preprocessor_dependencies(self):
         manifest = self.tmppath('m')
         deps = self.tmppath('m.pp')
@@ -283,13 +335,17 @@ class TestInstallManifest(TestWithTmpDir
         include = self.tmppath('p_incl')
         os.mkdir(dest)
 
-        with open(source, 'wt') as fh:
+        fh = open(source, 'wt').__enter__()
+        if 1:
             fh.write('#define SRC\nSOURCE\n')
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(source) - 3
         os.utime(source, (time, time))
 
-        with open(include, 'wt') as fh:
+        fh = open(include, 'wt').__enter__()
+        if 1:
             fh.write('INCLUDE\n')
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(source) - 3
         os.utime(include, (time, time))
 
@@ -308,12 +364,16 @@ class TestInstallManifest(TestWithTmpDir
         m.populate_registry(c)
         self.assertTrue(c.copy(dest))
 
-        with open(destfile, 'rt') as fh:
+        fh = open(destfile, 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'SOURCE\n')
 
+        fh.__exit__(0, 0, 0)
         # Next, modify the source to #INCLUDE another file.
-        with open(source, 'wt') as fh:
+        fh = open(source, 'wt').__enter__()
+        if 1:
             fh.write('SOURCE\n#include p_incl\n')
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(source) - 1
         os.utime(destfile, (time, time))
 
@@ -324,17 +384,21 @@ class TestInstallManifest(TestWithTmpDir
         m.populate_registry(c)
         c.copy(dest)
 
-        with open(destfile, 'rt') as fh:
+        fh = open(destfile, 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'SOURCE\nINCLUDE\n')
 
+        fh.__exit__(0, 0, 0)
         # Set the time on the source file back, so it won't be picked up as
         # modified in the next test.
         time = os.path.getmtime(source) - 1
         os.utime(source, (time, time))
 
         # Now, modify the include file (but not the original source).
-        with open(include, 'wt') as fh:
+        fh = open(include, 'wt').__enter__()
+        if 1:
             fh.write('INCLUDE MODIFIED\n')
+        fh.__exit__(0, 0, 0)
         time = os.path.getmtime(include) - 1
         os.utime(destfile, (time, time))
 
@@ -345,8 +409,10 @@ class TestInstallManifest(TestWithTmpDir
         m.populate_registry(c)
         c.copy(dest)
 
-        with open(destfile, 'rt') as fh:
+        fh = open(destfile, 'rt').__enter__()
+        if 1:
             self.assertEqual(fh.read(), 'SOURCE\nINCLUDE MODIFIED\n')
 
+        fh.close()
 if __name__ == '__main__':
     mozunit.main()
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_mozjar.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_mozjar.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_mozjar.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_mozjar.py	2014-09-05 15:26:14.096681129 +0200
@@ -53,7 +53,7 @@ class TestJarStruct(unittest.TestCase):
         foo['string'] = 'abcde'
         foo['string2'] = 'Arbitrarily long string'
 
-        serialized = b'\x04\x03\x02\x01\x45\x44\x43\x42\xcd\xab\x01\xef' + \
+        serialized = '\x04\x03\x02\x01\x45\x44\x43\x42\xcd\xab\x01\xef' + \
                      b'\x05\x00\x17\x00abcdeArbitrarily long string'
         self.assertEqual(foo.size, len(serialized))
         foo_serialized = foo.serialize()
@@ -73,12 +73,12 @@ class TestJarStruct(unittest.TestCase):
         self.assertEqual(foo['string2'], '67')
 
     def test_read_jar_struct(self):
-        data = b'\x00\x04\x03\x02\x01\x42\x43\x44\x45\xab\xcd\xef' + \
+        data = '\x00\x04\x03\x02\x01\x42\x43\x44\x45\xab\xcd\xef' + \
                b'\x01\x06\x00\x02\x0001234567890'
         self.do_test_read_jar_struct(data)
 
     def test_read_jar_struct_memoryview(self):
-        data = b'\x00\x04\x03\x02\x01\x42\x43\x44\x45\xab\xcd\xef' + \
+        data = '\x00\x04\x03\x02\x01\x42\x43\x44\x45\xab\xcd\xef' + \
                b'\x01\x06\x00\x02\x0001234567890'
         self.do_test_read_jar_struct(memoryview(data))
 
@@ -130,12 +130,14 @@ class TestJar(unittest.TestCase):
 
     def test_jar(self):
         s = MockDest()
-        with JarWriter(fileobj=s, optimize=self.optimize) as jar:
+        jar = JarWriter(fileobj=s, optimize=self.optimize).__enter__()
+        if 1:
             jar.add('foo', 'foo')
             self.assertRaises(JarWriterError, jar.add, 'foo', 'bar')
             jar.add('bar', 'aaaaaaaaaaaaanopqrstuvwxyz')
             jar.add('baz/qux', 'aaaaaaaaaaaaanopqrstuvwxyz', False)
 
+        jar.__exit__(0, 0, 0)
         files = [j for j in JarReader(fileobj=s)]
 
         self.assertEqual(files[0].filename, 'foo')
@@ -204,16 +206,20 @@ class TestJar(unittest.TestCase):
 
     def test_rejar(self):
         s = MockDest()
-        with JarWriter(fileobj=s, optimize=self.optimize) as jar:
+        jar = JarWriter(fileobj=s, optimize=self.optimize).__enter__()
+        if 1:
             jar.add('foo', 'foo')
             jar.add('bar', 'aaaaaaaaaaaaanopqrstuvwxyz')
             jar.add('baz/qux', 'aaaaaaaaaaaaanopqrstuvwxyz', False)
 
+        jar.__exit__(0, 0, 0)
         new = MockDest()
-        with JarWriter(fileobj=new, optimize=self.optimize) as jar:
+        jar = JarWriter(fileobj=new, optimize=self.optimize).__enter__()
+        if 1:
             for j in JarReader(fileobj=s):
                 jar.add(j.filename, j)
 
+        jar.__exit__(0, 0, 0)
         jar = JarReader(fileobj=new)
         files = [j for j in jar]
 
@@ -237,20 +243,24 @@ class TestOptimizeJar(TestJar):
 class TestPreload(unittest.TestCase):
     def test_preload(self):
         s = MockDest()
-        with JarWriter(fileobj=s) as jar:
+        jar = JarWriter(fileobj=s).__enter__()
+        if 1:
             jar.add('foo', 'foo')
             jar.add('bar', 'abcdefghijklmnopqrstuvwxyz')
             jar.add('baz/qux', 'aaaaaaaaaaaaanopqrstuvwxyz')
 
+        jar.__exit__(0, 0, 0)
         jar = JarReader(fileobj=s)
         self.assertEqual(jar.last_preloaded, None)
 
-        with JarWriter(fileobj=s) as jar:
+        jar = JarWriter(fileobj=s).__enter__()
+        if 1:
             jar.add('foo', 'foo')
             jar.add('bar', 'abcdefghijklmnopqrstuvwxyz')
             jar.add('baz/qux', 'aaaaaaaaaaaaanopqrstuvwxyz')
             jar.preload(['baz/qux', 'bar'])
 
+        jar.__exit__(0, 0, 0)
         jar = JarReader(fileobj=s)
         self.assertEqual(jar.last_preloaded, 'bar')
         files = [j for j in jar]
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_packager.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_packager.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_packager.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_packager.py	2014-09-05 15:26:14.096681129 +0200
@@ -69,12 +69,15 @@ class TestPreprocessManifest(unittest.Te
         self.sink = MockSink()
 
     def test_preprocess_manifest(self):
-        with MockedOpen({'manifest': MANIFEST}):
+        MockedOpen({'manifest': MANIFEST}).__enter__()
+        if 1:
             preprocess_manifest(self.sink, 'manifest')
+        MockedOpen({'manifest': MANIFEST}).__exit__(0, 0, 0)
         self.assertEqual(self.sink.log, self.EXPECTED_LOG)
 
     def test_preprocess_manifest_missing_define(self):
-        with MockedOpen({'manifest': MANIFEST}):
+        MockedOpen({'manifest': MANIFEST}).__enter__()
+        if 1:
             self.assertRaises(
                 Preprocessor.Error,
                 preprocess_manifest,
@@ -83,10 +86,13 @@ class TestPreprocessManifest(unittest.Te
                 {'baz': 1}
             )
 
+        MockedOpen({'manifest': MANIFEST}).__exit__(0, 0, 0)
     def test_preprocess_manifest_defines(self):
-        with MockedOpen({'manifest': MANIFEST}):
+        MockedOpen({'manifest': MANIFEST}).__enter__()
+        if 1:
             preprocess_manifest(self.sink, 'manifest',
                                 {'baz': 1, 'SUFFIX': '.exe'})
+        MockedOpen({'manifest': MANIFEST}).__exit__(0, 0, 0)
         self.assertEqual(self.sink.log, self.EXPECTED_LOG +
                          [((self.MANIFEST_PATH, 12), 'add', 'baz', 'baz.exe')])
 
@@ -139,42 +145,58 @@ class TestSimplePackager(unittest.TestCa
         file = GeneratedFileWithPath(os.path.join(curdir, 'foo',
                                                   'bar.manifest'),
                                      'resource bar bar/\ncontent bar bar/')
-        with errors.context('manifest', 1):
+        errors.context('manifest', 1).__enter__()
+        if 1:
             packager.add('foo/bar.manifest', file)
 
+        errors.context('manifest', 1).__exit__(0, 0, 0)
         file = GeneratedFileWithPath(os.path.join(curdir, 'foo',
                                                   'baz.manifest'),
                                      'resource baz baz/')
-        with errors.context('manifest', 2):
+        errors.context('manifest', 2).__enter__()
+        if 1:
             packager.add('bar/baz.manifest', file)
 
-        with errors.context('manifest', 3):
+        errors.context('manifest', 2).__exit__(0, 0, 0)
+        errors.context('manifest', 3).__enter__()
+        if 1:
             packager.add('qux/qux.manifest',
                          GeneratedFile('resource qux qux/'))
+        errors.context('manifest', 3).__exit__(0, 0, 0)
         bar_xpt = GeneratedFile('bar.xpt')
         qux_xpt = GeneratedFile('qux.xpt')
         foo_html = GeneratedFile('foo_html')
         bar_html = GeneratedFile('bar_html')
-        with errors.context('manifest', 4):
+        errors.context('manifest', 4).__enter__()
+        if 1:
             packager.add('foo/bar.xpt', bar_xpt)
-        with errors.context('manifest', 5):
+        errors.context('manifest', 4).__exit__(0, 0, 0)
+        errors.context('manifest', 5).__enter__()
+        if 1:
             packager.add('foo/bar/foo.html', foo_html)
             packager.add('foo/bar/bar.html', bar_html)
 
+        errors.context('manifest', 5).__exit__(0, 0, 0)
         file = GeneratedFileWithPath(os.path.join(curdir, 'foo.manifest'),
                                      ''.join([
                                          'manifest foo/bar.manifest\n',
                                          'manifest bar/baz.manifest\n',
                                      ]))
-        with errors.context('manifest', 6):
+        errors.context('manifest', 6).__enter__()
+        if 1:
             packager.add('foo.manifest', file)
-        with errors.context('manifest', 7):
+        errors.context('manifest', 6).__exit__(0, 0, 0)
+        errors.context('manifest', 7).__enter__()
+        if 1:
             packager.add('foo/qux.xpt', qux_xpt)
 
+        errors.context('manifest', 7).__exit__(0, 0, 0)
         self.assertEqual(formatter.log, [])
 
-        with errors.context('dummy', 1):
+        errors.context('dummy', 1).__enter__()
+        if 1:
             packager.close()
+        errors.context('dummy', 1).__exit__(0, 0, 0)
         self.maxDiff = None
         # The formatter is expected to reorder the manifest entries so that
         # chrome entries appear before the others.
diff -up mozilla-esr31/python/mozbuild/mozpack/test/test_unify.py.python3 mozilla-esr31/python/mozbuild/mozpack/test/test_unify.py
--- mozilla-esr31/python/mozbuild/mozpack/test/test_unify.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/test/test_unify.py	2014-09-05 15:26:14.096681129 +0200
@@ -105,22 +105,28 @@ class TestUnifiedBuildFinder(TestUnified
                          ]))])
 
         xpi = MockDest()
-        with JarWriter(fileobj=xpi, compress=True) as jar:
+        jar = JarWriter(fileobj=xpi, compress=True).__enter__()
+        if 1:
             jar.add('foo', 'foo')
             jar.add('bar', 'bar')
+        jar.__exit__(0, 0, 0)
         foo_xpi = xpi.read()
         self.create_both('foo.xpi', foo_xpi)
 
-        with JarWriter(fileobj=xpi, compress=True) as jar:
+        jar = JarWriter(fileobj=xpi, compress=True).__enter__()
+        if 1:
             jar.add('foo', 'bar')
+        jar.__exit__(0, 0, 0)
         self.create_one('a', 'bar.xpi', foo_xpi)
         self.create_one('b', 'bar.xpi', xpi.read())
 
         errors.out = StringIO()
-        with self.assertRaises(AccumulatedErrors), errors.accumulate():
+        self.assertRaises(AccumulatedErrors), errors.accumulate().__enter__()
+        if 1:
             self.assertEqual([(f, c.open().read()) for f, c in
                               finder.find('*.xpi')],
                              [('foo.xpi', foo_xpi)])
+        self.assertRaises(AccumulatedErrors), errors.accumulate().__exit__(0, 0, 0)
         errors.out = sys.stderr
 
 
diff -up mozilla-esr31/python/mozbuild/mozpack/unify.py.python3 mozilla-esr31/python/mozbuild/mozpack/unify.py
--- mozilla-esr31/python/mozbuild/mozpack/unify.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozbuild/mozpack/unify.py	2014-09-05 15:26:14.096681129 +0200
@@ -19,7 +19,7 @@ import mozpack.path
 import struct
 import os
 import subprocess
-from collections import OrderedDict
+from ordereddict import OrderedDict
 
 
 def may_unify_binary(file):
@@ -80,8 +80,7 @@ class UnifiedFinder(BaseFinder):
         Initialize a UnifiedFinder. finder1 and finder2 are BaseFinder
         instances from which files are picked. UnifiedFinder.find() will act as
         FileFinder.find() but will error out when matches can only be found in
-        one of the two trees and not the other. It will also error out if
-        matches can be found on both ends but their contents are not identical.
+        one of the two trees and not the other. It will also error out if matches can be found on both ends but their contents are not identical.
 
         The sorted argument gives a list of mozpack.path.match patterns. File
         paths matching one of these patterns will have their contents compared
diff -up mozilla-esr31/python/mozversioncontrol/mozversioncontrol/repoupdate.py.python3 mozilla-esr31/python/mozversioncontrol/mozversioncontrol/repoupdate.py
--- mozilla-esr31/python/mozversioncontrol/mozversioncontrol/repoupdate.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/mozversioncontrol/mozversioncontrol/repoupdate.py	2014-09-05 15:26:14.096681129 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this,
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import subprocess
diff -up mozilla-esr31/python/psutil/psutil/_common.py.python3 mozilla-esr31/python/psutil/psutil/_common.py
--- mozilla-esr31/python/psutil/psutil/_common.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/psutil/_common.py	2014-09-05 15:26:14.097681134 +0200
@@ -6,7 +6,7 @@
 
 """Common objects shared by all _ps* modules."""
 
-from __future__ import division
+
 import sys
 import os
 import stat
diff -up mozilla-esr31/python/psutil/psutil/__init__.py.python3 mozilla-esr31/python/psutil/psutil/__init__.py
--- mozilla-esr31/python/psutil/psutil/__init__.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/psutil/__init__.py	2014-09-05 15:26:14.097681134 +0200
@@ -10,7 +10,7 @@ processes and gather system information
 Python.
 """
 
-from __future__ import division
+
 
 __version__ = "1.0.1"
 version_info = tuple([int(num) for num in __version__.split('.')])
@@ -229,8 +229,7 @@ class Process(object):
                 ret = ad_value
             except NotImplementedError:
                 # in case of not implemented functionality (may happen
-                # on old or exotic systems) we want to crash only if
-                # the user explicitly asked for that particular attr
+                # on old or exotic systems) we want to crash only if # the user explicitly asked for that particular attr
                 if attrs:
                     raise
                 continue
@@ -368,8 +367,7 @@ class Process(object):
 
         @property
         def terminal(self):
-            """The terminal associated with this process, if any,
-            else None.
+            """The terminal associated with this process,any, = (None., )[]
             """
             return self._platform_impl.get_process_terminal()
 
@@ -795,8 +793,7 @@ class Process(object):
             self._platform_impl.kill_process()
 
     def wait(self, timeout=None):
-        """Wait for process to terminate and, if process is a children
-        of the current one also return its exit code, else None.
+        """Wait for process to terminate and,process is a children of the current one also return its exit code, = (None., )[]
         """
         if timeout is not None and not timeout >= 0:
             raise ValueError("timeout must be a positive integer")
diff -up mozilla-esr31/python/psutil/psutil/_pslinux.py.python3 mozilla-esr31/python/psutil/psutil/_pslinux.py
--- mozilla-esr31/python/psutil/psutil/_pslinux.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/psutil/_pslinux.py	2014-09-05 15:26:14.097681134 +0200
@@ -6,7 +6,7 @@
 
 """Linux platform implementation."""
 
-from __future__ import division
+
 
 import os
 import errno
@@ -437,8 +437,7 @@ def wrap_exceptions(fun):
             return fun(self, *args, **kwargs)
         except EnvironmentError:
             # ENOENT (no such file or directory) gets raised on open().
-            # ESRCH (no such process) can get raised on read() if
-            # process is gone in meantime.
+            # ESRCH (no such process) can get raised on read() if # process is gone in meantime.
             err = sys.exc_info()[1]
             if err.errno in (errno.ENOENT, errno.ESRCH):
                 raise NoSuchProcess(self.pid, self._process_name)
diff -up mozilla-esr31/python/psutil/psutil/_pssunos.py.python3 mozilla-esr31/python/psutil/psutil/_pssunos.py
--- mozilla-esr31/python/psutil/psutil/_pssunos.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/psutil/_pssunos.py	2014-09-05 15:26:14.097681134 +0200
@@ -148,8 +148,7 @@ def wrap_exceptions(callable):
             return callable(self, *args, **kwargs)
         except EnvironmentError:
             # ENOENT (no such file or directory) gets raised on open().
-            # ESRCH (no such process) can get raised on read() if
-            # process is gone in meantime.
+            # ESRCH (no such process) can get raised on read() if # process is gone in meantime.
             err = sys.exc_info()[1]
             if err.errno in (errno.ENOENT, errno.ESRCH):
                 raise NoSuchProcess(self.pid, self._process_name)
@@ -287,8 +286,7 @@ class Process(object):
 
     @wrap_exceptions
     def get_process_cwd(self):
-        # /proc/PID/path/cwd may not be resolved by readlink() even if
-        # it exists (ls shows it). If that's the case and the process
+        # /proc/PID/path/cwd may not be resolved by readlink() even if # it exists (ls shows it). If that's the case and the process
         # is still alive return None (we can return None also on BSD).
         # Reference: http://goo.gl/55XgO
         try:
diff -up mozilla-esr31/python/psutil/test/_linux.py.python3 mozilla-esr31/python/psutil/test/_linux.py
--- mozilla-esr31/python/psutil/test/_linux.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/test/_linux.py	2014-09-05 15:26:14.097681134 +0200
@@ -6,7 +6,7 @@
 
 """Linux specific tests.  These are implicitly run by test_psutil.py."""
 
-from __future__ import division
+
 import unittest
 import subprocess
 import sys
diff -up mozilla-esr31/python/psutil/test/test_memory_leaks.py.python3 mozilla-esr31/python/psutil/test/test_memory_leaks.py
--- mozilla-esr31/python/psutil/test/test_memory_leaks.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/test/test_memory_leaks.py	2014-09-05 15:26:14.098681138 +0200
@@ -60,8 +60,7 @@ class Base(unittest.TestCase):
             # function so many times the memory usage is stabilized
             # and if there are no leaks it should not increase any
             # more.
-            # Let's keep calling fun for 3 more seconds and fail if
-            # we notice any difference.
+            # Let's keep calling fun for 3 more seconds and fail if # we notice any difference.
             stop_at = time.time() + 3
             while 1:
                 self.call(function, *args, **kwargs)
diff -up mozilla-esr31/python/psutil/test/test_psutil.py.python3 mozilla-esr31/python/psutil/test/test_psutil.py
--- mozilla-esr31/python/psutil/test/test_psutil.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/python/psutil/test/test_psutil.py	2014-09-05 15:26:14.098681138 +0200
@@ -14,7 +14,7 @@ If you're on Python < 2.7 it is recommen
 from: https://pypi.python.org/pypi/unittest2
 """
 
-from __future__ import division
+
 import os
 import sys
 import subprocess
diff -up mozilla-esr31/security/apps/gen_cert_header.py.python3 mozilla-esr31/security/apps/gen_cert_header.py
--- mozilla-esr31/security/apps/gen_cert_header.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/security/apps/gen_cert_header.py	2014-09-05 15:26:14.098681138 +0200
@@ -6,7 +6,8 @@ import sys
 import binascii
 
 def file_byte_generator(filename, block_size = 512):
-  with open(filename, "rb") as f:
+  f = open(filename, "rb")
+  if 1:
     while True:
       block = f.read(block_size)
       if block:
@@ -15,6 +16,7 @@ def file_byte_generator(filename, block_
       else:
         break
 
+  f.close()
 def create_header(array_name, in_filename):
   hexified = ["0x" + binascii.hexlify(byte) for byte in file_byte_generator(in_filename)]
   print "const uint8_t " + array_name + "[] = {"
diff -up mozilla-esr31/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py.python3 mozilla-esr31/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py
--- mozilla-esr31/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py.python3	2014-08-25 15:17:25.000000000 +0200
+++ mozilla-esr31/security/manager/ssl/tests/unit/test_signed_apps/gentestfiles/sign_b2g_app.py	2014-09-05 15:26:14.098681138 +0200
@@ -50,8 +50,10 @@ def sign_zip(in_zipfile_name, out_zipfil
 
   total_uncompressed_len = 0
   entry_count = 0
-  with zipfile.ZipFile(out_zipfile_name, 'w') as out_zip:
-    with zipfile.ZipFile(in_zipfile_name, 'r') as in_zip:
+  out_zip = zipfile.ZipFile(out_zipfile_name, 'w').__enter__()
+  if 1:
+    in_zip = zipfile.ZipFile(in_zipfile_name, 'r').__enter__()
+    if 1:
       for entry_info in in_zip.infolist():
         name = entry_info.filename
 
@@ -98,6 +100,7 @@ def sign_zip(in_zipfile_name, out_zipfil
           # Add the entry to the manifest we're building
           mf_entries.append('Name: %s\nSHA1-Digest: %s\n'
                                 % (name, b64encode(sha1(contents).digest())))
+    in_zip.__exit__(0, 0, 0)
     if (ids_json):
       mf_entries.append('Name: %s\nSHA1-Digest: %s\n'
                         % ("META-INF/ids.json", b64encode(sha1(ids_json).digest())))
@@ -121,6 +124,7 @@ def sign_zip(in_zipfile_name, out_zipfil
     if (ids_json):
         out_zip.writestr("META-INF/ids.json", ids_json, zipfile.ZIP_DEFLATED)
 
+  out_zip.__exit__(0, 0, 0)
 def main():
   parser = argparse.ArgumentParser(description='Sign a B2G app.')
   parser.add_argument('-d', action='store',
diff -up mozilla-esr31/testing/gtest/rungtests.py.python3 mozilla-esr31/testing/gtest/rungtests.py
--- mozilla-esr31/testing/gtest/rungtests.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/gtest/rungtests.py	2014-09-05 15:26:14.098681138 +0200
@@ -4,7 +4,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 import sys, os
 from optparse import OptionParser
 import mozprocess, mozinfo, mozlog, mozcrash
@@ -117,7 +117,7 @@ def main():
     except Exception, e:
         log.error(str(e))
         result = False
-    sys.exit(0 if result else 1)
+    sys.exit(1, 0)[result]
 
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/testing/mach_commands.py.python3 mozilla-esr31/testing/mach_commands.py
--- mozilla-esr31/testing/mach_commands.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mach_commands.py	2014-09-05 15:26:14.098681138 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 
@@ -213,7 +217,10 @@ class MachCommands(MachCommandBase):
                 'Caught exception running cpp unit tests: {exception}')
             result = False
 
-        return 0 if result else 1
+        if result:
+          return 0
+        else:
+          return 1
 
 @CommandProvider
 class JittestCommand(MachCommandBase):
diff -up mozilla-esr31/testing/marionette/client/marionette/b2gbuild.py.python3 mozilla-esr31/testing/marionette/client/marionette/b2gbuild.py
--- mozilla-esr31/testing/marionette/client/marionette/b2gbuild.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/b2gbuild.py	2014-09-05 15:26:14.099681143 +0200
@@ -82,7 +82,11 @@ class B2GBuild(object):
         self.homedir = homedir
         self.adb_path = self.check_adb(self.homedir)
         self.update_tools = os.path.join(self.homedir, 'tools', 'update-tools')
-        self.fastboot_path = None if emulator else self.check_fastboot(self.homedir)
+        self.fastboot_path = None
+        if emulator:
+          self.fastboot_path = None
+        else:
+          self.fastboot_path = self.check_fastboot(self.homedir)
 
     def import_update_tools(self):
         """Import the update_tools package from B2G"""
diff -up mozilla-esr31/testing/marionette/client/marionette/b2g_update_test.py.python3 mozilla-esr31/testing/marionette/client/marionette/b2g_update_test.py
--- mozilla-esr31/testing/marionette/client/marionette/b2g_update_test.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/b2g_update_test.py	2014-09-05 15:26:14.099681143 +0200
@@ -163,9 +163,11 @@ class B2GUpdateTestCase(MarionetteTestCa
 
         update_test_js = os.path.join(os.path.dirname(__file__), 'atoms',
                                       'b2g_update_test.js')
-        with open(update_test_js, 'r') as f:
+        f = open(update_test_js, 'r')
+        if 1:
             self.update_test_js = f.read()
 
+        f.__exit__(0, 0, 0)
         self.b2g_pid = self.runner.find_b2g_pid()
         if not self.b2g_pid:
             raise Exception('B2G PID could not be found for update test')
@@ -228,9 +230,11 @@ class B2GUpdateTestCase(MarionetteTestCa
 
     def execute_update_js(self, path, stage=None, will_restart=True):
         data = self.update_test_js[:]
-        with open(path, "r") as f:
+        f = open(path, "r").__enter__()
+        if 1:
             data += f.read()
 
+        f.close()
         status = 'EXEC'
         if stage:
             status += '-' + stage.upper()
@@ -254,12 +258,16 @@ class B2GUpdateTestCase(MarionetteTestCa
         failed = results['failed']
 
         fails = StringIO()
-        stage_msg = ' %s' % stage if stage else ''
+        stage_msg = None
+        if stage:
+          stage_msg = ' %s' % stage
+        else:
+          stage_msg = ''
         fails.write('%d%s tests failed:\n' % (failed, stage_msg))
 
         for failure in results['failures']:
             diag = failure.get('diag')
-            diag_msg = "" if not diag else "| %s " % diag
+            diag_msg = ("| %s " % diag, "")[not diag]
             name = failure.get('name') or 'got false, expected true'
             fails.write('TEST-UNEXPECTED-FAIL | %s %s| %s\n' %
                         (os.path.basename(path), diag_msg, name))
diff -up mozilla-esr31/testing/marionette/client/marionette/emulator.py.python3 mozilla-esr31/testing/marionette/client/marionette/emulator.py
--- mozilla-esr31/testing/marionette/client/marionette/emulator.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/emulator.py	2014-09-05 15:26:14.099681143 +0200
@@ -171,8 +171,7 @@ class Emulator(object):
 
     def check_for_crash(self):
         """
-        Checks if the emulator has crashed or not.  Always returns False if
-        we've connected to an already-running emulator, since we can't track
+        Checks if the emulator has crashed or not.  Always returns False if we've connected to an already-running emulator, since we can't track
         the emulator's pid in that case.  Otherwise, returns True iff
         self.proc is not None (meaning the emulator hasn't been explicitly
         closed), and self.proc.poll() is also not None (meaning the emulator
@@ -317,8 +316,10 @@ waitFor(
     def add_prefs_to_profile(self, prefs=()):
         local_user_js = tempfile.mktemp(prefix='localuserjs')
         self.dm.getFile(self.remote_user_js, local_user_js)
-        with open(local_user_js, 'a') as f:
+        f = open(local_user_js, 'a')
+        if 1:
             f.write('%s\n' % '\n'.join(prefs))
+        f.close()
         self.dm.pushFile(local_user_js, self.remote_user_js)
 
     def start(self):
diff -up mozilla-esr31/testing/marionette/client/marionette/marionette.py.python3 mozilla-esr31/testing/marionette/client/marionette/marionette.py
--- mozilla-esr31/testing/marionette/client/marionette/marionette.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/marionette.py	2014-09-05 15:26:14.099681143 +0200
@@ -1291,8 +1291,10 @@ class Marionette(object):
           assert "i'm a test function!" == self.marionette.execute_script("return testFunc();")
         '''
         js = ''
-        with open(js_file, 'r') as f:
+        f = open(js_file, 'r')
+        if 1:
             js = f.read()
+        f.close()
         return self._send_message('importScript', 'ok', script=js)
 
     def clear_imported_scripts(self):
diff -up mozilla-esr31/testing/marionette/client/marionette/marionette_test.py.python3 mozilla-esr31/testing/marionette/client/marionette/marionette_test.py
--- mozilla-esr31/testing/marionette/client/marionette/marionette_test.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/marionette_test.py	2014-09-05 15:26:14.099681143 +0200
@@ -143,11 +143,11 @@ class CommonTestCase(unittest.TestCase):
                         raise _ExpectedFailure(sys.exc_info())
                 else:
                     self.setUp()
-            except SkipTest as e:
+            except SkipTest, e:
                 self._addSkip(result, str(e))
             except KeyboardInterrupt:
                 raise
-            except _ExpectedFailure as e:
+            except _ExpectedFailure, e:
                 expected_failure(result, e.exc_info)
             except:
                 result.addError(self, sys.exc_info())
@@ -165,7 +165,7 @@ class CommonTestCase(unittest.TestCase):
                     result.addFailure(self, sys.exc_info())
                 except KeyboardInterrupt:
                     raise
-                except _ExpectedFailure as e:
+                except _ExpectedFailure, e:
                     expected_failure(result, e.exc_info)
                 except _UnexpectedSuccess:
                     addUnexpectedSuccess = getattr(result, 'addUnexpectedSuccess', None)
@@ -175,7 +175,7 @@ class CommonTestCase(unittest.TestCase):
                         warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failures",
                                       RuntimeWarning)
                         result.addFailure(self, sys.exc_info())
-                except SkipTest as e:
+                except SkipTest, e:
                     self._addSkip(result, str(e))
                 except:
                     result.addError(self, sys.exc_info())
@@ -191,7 +191,7 @@ class CommonTestCase(unittest.TestCase):
                         self.tearDown()
                 except KeyboardInterrupt:
                     raise
-                except _ExpectedFailure as e:
+                except _ExpectedFailure, e:
                     expected_failure(result, e.exc_info)
                 except:
                     result.addError(self, sys.exc_info())
@@ -498,8 +498,16 @@ setReq.onerror = function() {
             else:
                 fails = []
                 for failure in results['failures']:
-                    diag = "" if failure.get('diag') is None else "| %s " % failure['diag']
-                    name = "got false, expected true" if failure.get('name') is None else failure['name']
+                    diag = None
+                    if failure.get('diag') is None:
+                      diag = "" # ("", "| %s " % failure['diag'] name = "got false, expected true")[failure.get('diag') is None]
+                    else:
+                      diag = failure['diag']
+                    name = ""
+                    if failure.get('name') is None:
+                      name = "got false, expected true"
+                    else:
+                      name = failure['name']
                     fails.append('TEST-UNEXPECTED-FAIL | %s %s| %s' %
                                  (os.path.basename(self.jsFile), diag, name))
                 self.assertEqual(0, results['failed'],
diff -up mozilla-esr31/testing/marionette/client/marionette/runner/base.py.python3 mozilla-esr31/testing/marionette/client/marionette/runner/base.py
--- mozilla-esr31/testing/marionette/client/marionette/runner/base.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/runner/base.py	2014-09-05 15:26:14.100681148 +0200
@@ -123,7 +123,7 @@ class MarionetteTestResult(unittest._Tex
         for modifier in self.result_modifiers:
             result_expected, result_actual, output, context = modifier(t, result_expected, result_actual, output, context)
         t.finish(result_actual,
-                 time_end=time.time() if test.start_time else 0,
+                 time_end=(0, time.time())[test.start_time],
                  reason=relevant_line(output),
                  output=output)
         self.append(t)
@@ -599,9 +599,11 @@ class BaseMarionetteTestRunner(object):
 
             import json
             try:
-                with open(testvars) as f:
+                f = open(testvars)
+                if 1:
                     self.testvars = json.loads(f.read())
-            except ValueError as e:
+                f.close()
+            except ValueError, e:
                 json_path = os.path.abspath(testvars)
                 raise Exception("JSON file (%s) is not properly "
                                 "formatted: %s" % (json_path, e.message))
@@ -823,9 +825,11 @@ class BaseMarionetteTestRunner(object):
             xml_dir = os.path.dirname(os.path.abspath(self.xml_output))
             if not os.path.exists(xml_dir):
                 os.makedirs(xml_dir)
-            with open(self.xml_output, 'w') as f:
+            f = open(self.xml_output, 'w')
+            if 1:
                 f.write(self.generate_xml(self.results))
 
+            f.close()
         if self.marionette.instance:
             self.marionette.instance.close()
             self.marionette.instance = None
diff -up mozilla-esr31/testing/marionette/client/marionette/runner/mixins/endurance.py.python3 mozilla-esr31/testing/marionette/client/marionette/runner/mixins/endurance.py
--- mozilla-esr31/testing/marionette/client/marionette/runner/mixins/endurance.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/runner/mixins/endurance.py	2014-09-05 15:26:14.100681148 +0200
@@ -112,13 +112,17 @@ class EnduranceTestCaseMixin(object):
             if not os.path.exists(self.checkpoint_path):
                 os.makedirs(self.checkpoint_path, 0755)
             self.log_name = "%s/checkpoint_%s_%s.log" % (self.checkpoint_path, self.test_method.__name__, self.cur_time)
-            with open(self.log_name, 'a') as log_file:
+            log_file = open(self.log_name, 'a')
+            if 1:
                 log_file.write('%s Endurance Test: %s\n' % (self.cur_time, self.test_method.__name__))
                 log_file.write('%s Checkpoint after iteration %d of %d:\n' % (self.cur_time, self.iteration, self.iterations))
+            log_file.__exit__(0, 0, 0)
         else:
-            with open(self.log_name, 'a') as log_file:
+            log_file = open(self.log_name, 'a').__enter__()
+            if 1:
                 log_file.write('%s Checkpoint after iteration %d of %d:\n' % (self.cur_time, self.iteration, self.iterations))
 
+            log_file.close()
         for function in self.checkpoint_functions:
             function()
 
@@ -146,9 +150,11 @@ class MemoryEnduranceTestCaseMixin(objec
         # Dump out some memory status info
         self.marionette.log("checkpoint")
         output_str = self.device_manager.shellCheckOutput(["b2g-ps"])
-        with open(self.log_name, 'a') as log_file:
+        log_file = open(self.log_name, 'a')
+        if 1:
             log_file.write('%s\n' % output_str)
 
+        log_file.close()
     def memory_b2g_process_checkpoint(self):
         # Process checkpoint data into .json
         self.marionette.log("processing checkpoint data from %s" % self.log_name)
diff -up mozilla-esr31/testing/marionette/client/marionette/runner/mixins/reporting.py.python3 mozilla-esr31/testing/marionette/client/marionette/runner/mixins/reporting.py
--- mozilla-esr31/testing/marionette/client/marionette/runner/mixins/reporting.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/runner/mixins/reporting.py	2014-09-05 15:26:14.100681148 +0200
@@ -39,9 +39,11 @@ class HTMLReportingTestRunnerMixin(objec
             html_dir = os.path.dirname(os.path.abspath(self.html_output))
             if not os.path.exists(html_dir):
                 os.makedirs(html_dir)
-            with open(self.html_output, 'w') as f:
+            f = open(self.html_output, 'w')
+            if 1:
                 f.write(self.generate_html(self.results))
 
+            f.close()
     def generate_html(self, results_list):
         tests = sum([results.testsRun for results in results_list])
         failures = sum([len(results.failures) for results in results_list])
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_errors.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_errors.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_errors.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_errors.py	2014-09-05 15:26:14.100681148 +0200
@@ -12,7 +12,7 @@ from errors import ErrorCodes
 def fake_cause():
     try:
         raise ValueError("bar")
-    except ValueError as e:
+    except ValueError, e:
         return sys.exc_info()
 
 message = "foo"
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_isolate.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_isolate.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_isolate.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_isolate.py	2014-09-05 15:26:14.100681148 +0200
@@ -13,7 +13,7 @@ class TestExecuteIsolationContent(Marion
     def test_execute_async_isolate(self):
         # Results from one execute call that has timed out should not
         # contaminate a future call.
-        multiplier = "*3" if self.content else "*1"
+        multiplier = ("*1", "*3")[self.content]
         self.marionette.set_script_timeout(500)
         self.assertRaises(ScriptTimeoutException,
                           self.marionette.execute_async_script,
@@ -24,7 +24,7 @@ class TestExecuteIsolationContent(Marion
         result = self.marionette.execute_async_script("""
 setTimeout(function() { marionetteScriptFinished(10%s); }, 5000);
 """ % multiplier)
-        self.assertEqual(result, 30 if self.content else 10)
+        self.assertEqual(result, (10, 30)[self.content])
 
 class TestExecuteIsolationChrome(TestExecuteIsolationContent):
     def setUp(self):
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_script.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_script.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_script.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_execute_script.py	2014-09-05 15:26:14.100681148 +0200
@@ -22,7 +22,7 @@ class TestExecuteContent(MarionetteTestC
                 """)
             self.assertFalse(True)
         except JavascriptException, inst:
-            self.assertTrue('return b' in inst.stacktrace)
+            self.assertTrue('return ' in inst.stacktrace)
 
     def test_execute_simple(self):
         self.assertEqual(1, self.marionette.execute_script("return 1;"))
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py	2014-09-05 15:26:14.100681148 +0200
@@ -99,7 +99,7 @@ class TestGetActiveFrameOOP(MarionetteTe
         else:
             self.marionette.execute_script("""
                 SpecialPowers.setBoolPref('dom.ipc.browser_frames.oop_by_default', %s);
-                """ % 'true' if self.oop_by_default else 'false')
+                """ % ('false, 'true')[self.oop_by_default])
         if self.mozBrowserFramesEnabled is None:
             self.marionette.execute_script("""
                 SpecialPowers.clearUserPref('dom.mozBrowserFramesEnabled');
@@ -107,4 +107,4 @@ class TestGetActiveFrameOOP(MarionetteTe
         else:
             self.marionette.execute_script("""
                 SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', %s);
-                """ % 'true' if self.mozBrowserFramesEnabled else 'false')
+                """ % ('false', 'true')[self.mozBrowserFramesEnabled])
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_navigation.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_navigation.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_navigation.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_navigation.py	2014-09-05 15:26:14.101681153 +0200
@@ -75,9 +75,9 @@ class TestNavigate(MarionetteTestCase):
             self.fail("Should have thrown a MarionetteException")
         except TimeoutException:
             self.fail("The socket shouldn't have timed out when navigating to a non-existent URL")
-        except MarionetteException as e:
+        except MarionetteException, e:
             self.assertIn("Error loading page", str(e))
-        except Exception as inst:
+        except Exception, inst:
             import traceback
             print traceback.format_exc()
             self.fail("Should have thrown a MarionetteException instead of %s" % type(inst))
@@ -96,9 +96,9 @@ class TestNavigate(MarionetteTestCase):
             self.marionette.navigate(test_html)
             self.assertTrue(self.marionette.find_element("id", "mozLink"))
             self.fail("Should have thrown a MarionetteException")
-        except MarionetteException as e:
+        except MarionetteException, e:
             self.assertTrue("Error loading page, timed out" in str(e))
-        except Exception as inst:
+        except Exception, inst:
             import traceback
             print traceback.format_exc()
             self.fail("Should have thrown a MarionetteException instead of %s" % type(inst))
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_screen_orientation.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_screen_orientation.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_screen_orientation.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_screen_orientation.py	2014-09-05 15:26:14.101681153 +0200
@@ -82,9 +82,14 @@ class TestScreenOrientation(MarionetteTe
         self.assertEqual(new_orientation, "landscape-primary")
 
     def test_set_invalid_orientation(self):
-        with self.assertRaisesRegexp(MarionetteException, unknown_orientation % "cheese"):
+        self.assertRaisesRegexp(MarionetteException, unknown_orientation % "cheese").__enter__()
+        if 1:
             self.marionette.set_orientation("cheese")
 
+        self.assertRaisesRegexp(MarionetteException, unknown_orientation % "cheese").__exit__(0, 0, 0)
     def test_set_null_orientation(self):
-        with self.assertRaisesRegexp(MarionetteException, unknown_orientation % "null"):
+        self.assertRaisesRegexp(MarionetteException, unknown_orientation % "null").__enter__()
+        if 1:
             self.marionette.set_orientation(None)
+        self.assertRaisesRegexp(MarionetteException, unknown_orientation % "null").__exit__(0, 0, 0)
+
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py	2014-09-05 15:26:14.101681153 +0200
@@ -45,5 +45,5 @@ class TestSwitchFrameChrome(MarionetteTe
         self.assertRaises(JavascriptException, self.marionette.execute_async_script, "foo();")
         try:
             self.marionette.execute_async_script("foo();")
-        except JavascriptException as e:
+        except JavascriptException, e:
             self.assertIn("foo", e.msg)
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_frame.py	2014-09-05 15:26:14.101681153 +0200
@@ -45,7 +45,7 @@ class TestSwitchFrame(MarionetteTestCase
         self.assertRaises(JavascriptException, self.marionette.execute_async_script, "foo();")
         try:
             self.marionette.execute_async_script("foo();")
-        except JavascriptException as e:
+        except JavascriptException, e:
             self.assertTrue("foo" in e.msg)
 
     def testShouldBeAbleToCarryOnWorkingIfTheFrameIsDeletedFromUnderUs(self):
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py	2014-09-05 15:26:14.101681153 +0200
@@ -84,7 +84,7 @@ class TestSwitchRemoteFrame(MarionetteTe
         else:
             self.marionette.execute_script("""
                 SpecialPowers.setBoolPref('dom.ipc.browser_frames.oop_by_default', %s);
-                """ % 'true' if self.oop_by_default else 'false')
+                """ % ('false', 'true')[self.oop_by_default])
         if self.mozBrowserFramesEnabled is None:
             self.marionette.execute_script("""
                 SpecialPowers.clearUserPref('dom.mozBrowserFramesEnabled');
@@ -92,4 +92,4 @@ class TestSwitchRemoteFrame(MarionetteTe
         else:
             self.marionette.execute_script("""
                 SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', %s);
-                """ % 'true' if self.mozBrowserFramesEnabled else 'false')
+                """ % ('false, 'true')[self.mozBrowserFramesEnabled])
diff -up mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_wait.py.python3 mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_wait.py
--- mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_wait.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/tests/unit/test_wait.py	2014-09-05 15:26:14.101681153 +0200
@@ -190,27 +190,33 @@ class WaitUntilTest(MarionetteTestCase):
         self.assertEqual(self.clock.ticks, 4)
 
     def test_timeout(self):
-        with self.assertRaises(errors.TimeoutException):
+        self.assertRaises(errors.TimeoutException).__enter__()
+        if 1:
             r = self.wt.until(lambda x: x.true(wait=15))
+        self.assertRaises(errors.TimeoutException).__exit__(0, 0, 0)
         self.assertEqual(self.clock.ticks, 10)
 
     def test_exception_raises_immediately(self):
-        with self.assertRaises(TypeError):
+        self.assertRaises(TypeError).__enter__()
+        if 1:
             self.wt.until(lambda x: x.exception(e=TypeError))
+        self.assertRaises(TypeError).__exit__(0, 0, 0)
         self.assertEqual(self.clock.ticks, 0)
 
     def test_ignored_exception(self):
         self.wt.exceptions = (TypeError,)
-        with self.assertRaises(errors.TimeoutException):
+        self.assertRaises(errors.TimeoutException).__enter__()
+        if 1:
             self.wt.until(lambda x: x.exception(e=TypeError))
 
+        self.assertRaises(errors.TimeoutException).__exit__(0, 0, 0)
     def test_ignored_exception_wrapped_in_timeoutexception(self):
         self.wt.exceptions = (TypeError,)
 
         exc = None
         try:
             self.wt.until(lambda x: x.exception(e=TypeError))
-        except Exception as e:
+        except Exception, e:
             exc = e
 
         s = str(exc)
@@ -220,18 +226,24 @@ class WaitUntilTest(MarionetteTestCase):
         self.assertIn("self.wt.until(lambda x: x.exception(e=TypeError))", s)
 
     def test_ignored_exception_after_timeout_is_not_raised(self):
-        with self.assertRaises(errors.TimeoutException):
+        self.assertRaises(errors.TimeoutException).__enter__()
+        if 1:
             r = self.wt.until(lambda x: x.exception(wait=15))
+        self.assertRaises(errors.TimeoutException).__exit__(0, 0, 0)
         self.assertEqual(self.clock.ticks, 10)
 
     def test_keyboard_interrupt(self):
-        with self.assertRaises(KeyboardInterrupt):
+        self.assertRaises(KeyboardInterrupt).__enter__()
+        if 1:
             self.wt.until(lambda x: x.exception(e=KeyboardInterrupt))
 
+        self.assertRaises(KeyboardInterrupt).__exit__(0, 0, 0)
     def test_system_exit(self):
-        with self.assertRaises(SystemExit):
+        self.assertRaises(SystemExit).__enter__()
+        if 1:
             self.wt.until(lambda x: x.exception(SystemExit))
 
+        self.assertRaises(SystemExit).__exit__(0, 0, 0)
     def test_true_condition_returns_immediately(self):
         r = self.wt.until(lambda x: x.true())
         self.assertIsInstance(r, bool)
@@ -249,9 +261,11 @@ class WaitUntilTest(MarionetteTestCase):
         self.assertEqual(self.clock.ticks, 1)
 
     def test_custom_predicate_times_out(self):
-        with self.assertRaises(errors.TimeoutException):
+        self.assertRaises(errors.TimeoutException).__enter__()
+        if 1:
             self.wt.until(lambda x: x.true(wait=4), is_true=at_third_attempt)
 
+        self.assertRaises(errors.TimeoutException).__exit__(0, 0, 0)
         self.assertEqual(self.clock.ticks, 2)
 
     def test_timeout_elapsed_duration(self):
@@ -270,7 +284,7 @@ class WaitUntilTest(MarionetteTestCase):
         exc = None
         try:
             self.wt.until(lambda x: x.exception(e=TypeError), message="hooba")
-        except errors.TimeoutException as e:
+        except errors.TimeoutException, e:
             exc = e
 
         result = str(exc)
@@ -281,7 +295,7 @@ class WaitUntilTest(MarionetteTestCase):
         exc = None
         try:
             self.wt.until(lambda x: x.exception(e=TypeError), message="")
-        except errors.TimeoutException as e:
+        except errors.TimeoutException, e:
             exc = e
 
         result = str(exc)
@@ -292,7 +306,7 @@ class WaitUntilTest(MarionetteTestCase):
         exc = None
         try:
             self.wt.until(False, None, None)
-        except errors.TimeoutException as e:
+        except errors.TimeoutException, e:
             exc = e
 
         result = str(exc)
diff -up mozilla-esr31/testing/marionette/client/marionette/wait.py.python3 mozilla-esr31/testing/marionette/client/marionette/wait.py
--- mozilla-esr31/testing/marionette/client/marionette/wait.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/client/marionette/wait.py	2014-09-05 15:26:14.101681153 +0200
@@ -120,9 +120,9 @@ class Wait(object):
         while not until(self.clock, self.end):
             try:
                 rv = condition(self.marionette)
-            except (KeyboardInterrupt, SystemExit) as e:
+            except (KeyboardInterrupt, SystemExit), e:
                 raise e
-            except self.exceptions as e:
+            except self.exceptions, e:
                 last_exc = sys.exc_info()
 
             if isinstance(rv, bool) and not rv:
@@ -139,7 +139,7 @@ class Wait(object):
 
         raise errors.TimeoutException(
             "Timed out after %s seconds%s" %
-            (round((self.clock.now - start), 1), message if message else ""),
+            (round((self.clock.now - start), 1), ("", message)[message]),
             cause=last_exc)
 
 def until_pred(clock, end):
diff -up mozilla-esr31/testing/marionette/mach_commands.py.python3 mozilla-esr31/testing/marionette/mach_commands.py
--- mozilla-esr31/testing/marionette/mach_commands.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/mach_commands.py	2014-09-05 15:26:14.101681153 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 import os
 
 from mozbuild.base import (
diff -up mozilla-esr31/testing/marionette/transport/marionette_transport/transport.py.python3 mozilla-esr31/testing/marionette/transport/marionette_transport/transport.py
--- mozilla-esr31/testing/marionette/transport/marionette_transport/transport.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/transport/marionette_transport/transport.py	2014-09-05 15:26:14.102681158 +0200
@@ -89,7 +89,7 @@ class MarionetteTransport(object):
                        range(0, len(data), self.max_packet_length)]:
             try: 
                 self.sock.send(packet)
-            except IOError as e:
+            except IOError, e:
                 if e.errno == errno.EPIPE:
                     raise IOError("%s: %s" % (str(e)), self.connection_lost_msg)
                 else:
diff -up mozilla-esr31/testing/marionette/update-smoketests/smoketest.py.python3 mozilla-esr31/testing/marionette/update-smoketests/smoketest.py
--- mozilla-esr31/testing/marionette/update-smoketests/smoketest.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/marionette/update-smoketests/smoketest.py	2014-09-05 15:26:14.102681158 +0200
@@ -52,9 +52,11 @@ class SmokeTestConfig(DictObject):
         self.build_data = {}
         self.flash_template = None
 
-        with open(os.path.join(build_dir, 'smoketest-config.json')) as f:
+        f = open(os.path.join(build_dir, 'smoketest-config.json'))
+        if 1:
             DictObject.__init__(self, json.loads(f.read()))
 
+        f.close()
         for required in self.TOP_LEVEL_REQUIRED:
             if required not in self:
                 raise SmokeTestConfigError('No "%s" found' % required)
@@ -76,12 +78,14 @@ class SmokeTestConfig(DictObject):
 
         build_dir = os.path.join(self.top_dir, device, build_id)
         flash_zip = os.path.join(build_dir, 'flash.zip')
-        with zipfile.ZipFile(flash_zip) as zip:
+        zip = zipfile.ZipFile(flash_zip).__enter__()
+        if 1:
             app_ini = ConfigParser()
             app_ini.readfp(zip.open('system/b2g/application.ini'))
             platform_ini = ConfigParser()
             platform_ini.readfp(zip.open('system/b2g/platform.ini'))
 
+        zip.__exit__(0, 0, 0)
         build_data = self.build_data[device][build_id] = DictObject({
             'app_version': app_ini.get('App', 'version'),
             'app_build_id': app_ini.get('App', 'buildid'),
diff -up mozilla-esr31/testing/mochitest/mach_commands.py.python3 mozilla-esr31/testing/mochitest/mach_commands.py
--- mozilla-esr31/testing/mochitest/mach_commands.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mochitest/mach_commands.py	2014-09-05 15:26:14.102681158 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import logging
 import mozpack.path
@@ -114,18 +114,22 @@ class MochitestRunner(MozbuildObject):
 
         # The imp module can spew warnings if the modules below have
         # already been imported, ignore them.
-        with warnings.catch_warnings():
+        warnings.catch_warnings().__enter__()
+        if 1:
             warnings.simplefilter('ignore')
 
             import imp
             path = os.path.join(self.mochitest_dir, 'runtestsb2g.py')
-            with open(path, 'r') as fh:
+            fh = open(path, 'r')
+            if 1:
                 imp.load_module('mochitest', fh, path,
                     ('.py', 'r', imp.PY_SOURCE))
 
+            fh.__exit__(0, 0, 0)
             import mochitest
             from mochitest_options import B2GOptions
 
+        warnings.catch_warnings().__exit__(0, 0, 0)
         parser = B2GOptions()
         options = parser.parse_args([])[0]
 
@@ -233,10 +237,12 @@ class MochitestRunner(MozbuildObject):
         if 'mochitest' not in sys.modules:
             import imp
             path = os.path.join(self.mochitest_dir, 'runtests.py')
-            with open(path, 'r') as fh:
+            fh = open(path, 'r').__enter__()
+            if 1:
                 imp.load_module('mochitest', fh, path,
                     ('.py', 'r', imp.PY_SOURCE))
 
+            fh.close()
         import mozinfo
         import mochitest
         from manifestparser import TestManifest
diff -up mozilla-esr31/testing/mochitest/mochitest_options.py.python3 mozilla-esr31/testing/mochitest/mochitest_options.py
--- mozilla-esr31/testing/mochitest/mochitest_options.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mochitest/mochitest_options.py	2014-09-05 15:26:14.102681158 +0200
@@ -51,7 +51,7 @@ class MochitestOptions(optparse.OptionPa
         { "action": "store",
           "type": "string",
           "dest": "utilityPath",
-          "default": build_obj.bindir if build_obj is not None else None,
+          "default": (None, build_obj.bindir)[build_obj is not None],
           "help": "absolute path to directory containing utility programs (xpcshell, ssltunnel, certutil)",
         }],
         [["--certificate-path"],
@@ -59,7 +59,7 @@ class MochitestOptions(optparse.OptionPa
           "type": "string",
           "dest": "certPath",
           "help": "absolute path to directory containing certificate store to use testing profile",
-          "default": os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs') if build_obj is not None else None,
+          "default": (None, os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs'))[build_obj is not None],
         }],
         [["--log-file"],
         { "action": "store",
diff -up mozilla-esr31/testing/mochitest/runtestsb2g.py.python3 mozilla-esr31/testing/mochitest/runtestsb2g.py
--- mozilla-esr31/testing/mochitest/runtestsb2g.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mochitest/runtestsb2g.py	2014-09-05 15:26:14.102681158 +0200
@@ -84,7 +84,7 @@ class B2GMochitest(MochitestUtilsMixin):
 
         # interpolate the preferences
         interpolation = { "server": "%s:%s" % (options.webServer, options.httpPort),
-                          "OOP": "true" if self.out_of_process else "false" }
+                          "OOP": ("false", "true" })[self.out_of_process]
         prefs = json.loads(json.dumps(prefs) % interpolation)
         for pref in prefs:
             prefs[pref] = Preferences.cast(prefs[pref])
diff -up mozilla-esr31/testing/mochitest/runtests.py.python3 mozilla-esr31/testing/mochitest/runtests.py
--- mozilla-esr31/testing/mochitest/runtests.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mochitest/runtests.py	2014-09-05 15:26:14.103681163 +0200
@@ -6,7 +6,7 @@
 Runs the Mochitest test harness.
 """
 
-from __future__ import with_statement
+
 import os
 import sys
 SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
@@ -104,8 +104,7 @@ else:
       # The method throws OSError if the PID is invalid, which we catch below.
       os.kill(pid, 0)
 
-      # Wait on it to see if it's a zombie. This can throw OSError.ECHILD if
-      # the process terminates before we get to this point.
+      # Wait on it to see if it's a zombie. This can throw OSError.ECHILD if # the process terminates before we get to this point.
       wpid, wstatus = os.waitpid(pid, os.WNOHANG)
       return wpid == 0
     except OSError, err:
@@ -133,7 +132,7 @@ class MochitestServer(object):
     self.webServer = options['webServer']
     self.httpPort = options['httpPort']
     self.shutdownURL = "http://%(server)s:%(port)s/server/shutdown" % { "server" : self.webServer, "port" : self.httpPort }
-    self.testPrefix = "'webapprt_'" if options.get('webapprtContent') else "undefined"
+    self.testPrefix = ("undefined", "'webapprt_'")[options.get('webapprtContent')]
 
     if options.get('httpdPath'):
         self._httpdPath = options['httpdPath']
@@ -191,9 +190,11 @@ class MochitestServer(object):
 
   def stop(self):
     try:
-      with urllib2.urlopen(self.shutdownURL) as c:
+      c = urllib2.urlopen(self.shutdownURL).__enter__()
+      if 1:
         c.read()
 
+      c.__exit__(0, 0, 0)
       # TODO: need ProcessHandler.poll()
       # https://bugzilla.mozilla.org/show_bug.cgi?id=912285
       #      rtncode = self._process.poll()
@@ -511,8 +512,10 @@ class MochitestUtilsMixin(object):
       paths.sort(path_sort)
 
       # Bug 883865 - add this functionality into manifestDestiny
-      with open(os.path.join(testdir, 'tests.json'), 'w') as manifestFile:
+      manifestFile = open(os.path.join(testdir, 'tests.json'), 'w')
+      if 1:
         manifestFile.write(json.dumps({'tests': paths}))
+      manifestFile.close()
       options.manifestFile = 'tests.json'
 
     return self.buildTestURL(options)
@@ -529,9 +532,11 @@ class MochitestUtilsMixin(object):
     self.server.start()
 
     if options.pidFile != "":
-      with open(options.pidFile + ".xpcshell.pid", 'w') as f:
+      f = open(options.pidFile + ".xpcshell.pid", 'w')
+      if 1:
         f.write("%s" % self.server._process.pid)
 
+      f.close()
   def startServers(self, options, debuggerInfo):
     # start servers and set ports
     # TODO: pass these values, don't set on `self`
@@ -602,9 +607,11 @@ class MochitestUtilsMixin(object):
       copy mochijar directory to profile as an extension so we have chrome://mochikit for all harness code
     """
     # Write chrome.manifest.
-    with open(os.path.join(options.profilePath, "extensions", "staged", "mochikit@mozilla.org", "chrome.manifest"), "a") as mfile:
+    mfile = open(os.path.join(options.profilePath, "extensions", "staged", "mochikit@mozilla.org", "chrome.manifest"), "a")
+    if 1:
       mfile.write(chrome)
 
+    mfile.close()
   def addChromeToProfile(self, options):
     "Adds MochiKit chrome tests to the profile."
 
@@ -623,11 +630,14 @@ toolbar#nav-bar {
   background-image: none !important;
 }
 """
-    with open(os.path.join(options.profilePath, "userChrome.css"), "a") as chromeFile:
+    chromeFile = open(os.path.join(options.profilePath, "userChrome.css"), "a")
+    if 1:
       chromeFile.write(chrome)
 
+    chromeFile.close()
     manifest = os.path.join(options.profilePath, "tests.manifest")
-    with open(manifest, "w") as manifestFile:
+    manifestFile = open(manifest, "w")
+    if 1:
       # Register chrome directory.
       chrometestDir = os.path.join(os.path.abspath("."), SCRIPT_DIR) + "/"
       if mozinfo.isWin:
@@ -638,6 +648,7 @@ toolbar#nav-bar {
         manifestFile.write("resource testing-common file:///%s\n" %
           options.testingModulesDir)
 
+    manifestFile.close()
     # Call installChromeJar().
     if not os.path.isdir(os.path.join(SCRIPT_DIR, self.jarDir)):
       log.testFail("invalid setup: missing mochikit extension")
@@ -660,7 +671,11 @@ overlay chrome://webapprt/content/webapp
   def getExtensionsToInstall(self, options):
     "Return a list of extensions to install in the profile"
     extensions = options.extensionsToInstall or []
-    appDir = options.app[:options.app.rfind(os.sep)] if options.app else options.utilityPath
+    appDir = None
+    if options.app:
+      appDir = options.app[:options.app.rfind(os.sep)]
+    else:
+      appDir = options.utilityPath
 
     extensionDirs = [
       # Extensions distributed with the test harness.
@@ -720,7 +735,8 @@ class SSLTunnel:
   def buildConfig(self, locations):
     """Create the ssltunnel configuration file"""
     configFd, self.configFile = tempfile.mkstemp(prefix="ssltunnel", suffix=".cfg")
-    with os.fdopen(configFd, "w") as config:
+    config = os.fdopen(configFd, "w").__enter__()
+    if 1:
       config.write("httpproxy:1\n")
       config.write("certdbdir:%s\n" % self.certPath)
       config.write("forward:127.0.0.1:%s\n" % self.httpPort)
@@ -731,6 +747,7 @@ class SSLTunnel:
         if loc.scheme == "https" and "nocert" not in loc.options:
           self.writeLocation(config, loc)
 
+    config.__exit__(0, 0, 0)
   def start(self):
     """ Starts the SSL Tunnel """
 
@@ -770,10 +787,13 @@ class Mochitest(MochitestUtilsMixin):
     # environment function for browserEnv
     self.environment = environment
 
-    # Max time in seconds to wait for server startup before tests will fail -- if
-    # this seems big, it's mostly for debug machines where cold startup
+    # Max time in seconds to wait for server startup before tests will fail -- if # this seems big, it's mostly for debug machines where cold startup
     # (particularly after a build) takes forever.
-    self.SERVER_STARTUP_TIMEOUT = 180 if mozinfo.info.get('debug') else 90
+    self.SERVER_STARTUP_TIMEOUT = None
+    if mozinfo.info.get('debug'):
+      self.SERVER_STARTUP_TIMEOUT = 180
+    else:
+      self.SERVER_STARTUP_TIMEOUT = 90
 
     # metro browser sub process id
     self.browserProcessId = None
@@ -795,9 +815,11 @@ class Mochitest(MochitestUtilsMixin):
     # https://bugzilla.mozilla.org/show_bug.cgi?id=746243#c35
 
     pwfilePath = os.path.join(options.profilePath, ".crtdbpw")
-    with open(pwfilePath, "w") as pwfile:
+    pwfile = open(pwfilePath, "w")
+    if 1:
       pwfile.write("\n")
 
+    pwfile.close()
     # Pre-create the certification database for the profile
     env = self.environment(xrePath=options.xrePath)
     bin_suffix = mozinfo.info.get('bin_suffix', '')
@@ -838,8 +860,8 @@ class Mochitest(MochitestUtilsMixin):
     """ create the profile and add optional chrome bits and files if requested """
     if options.browserChrome and options.timeout:
       options.extraPrefs.append("testing.browserTestHarness.timeout=%d" % options.timeout)
-    options.extraPrefs.append("browser.tabs.remote=%s" % ('true' if options.e10s else 'false'))
-    options.extraPrefs.append("browser.tabs.remote.autostart=%s" % ('true' if options.e10s else 'false'))
+    options.extraPrefs.append("browser.tabs.remote=%s" % (('false', 'true')[options.e10s]))
+    options.extraPrefs.append("browser.tabs.remote.autostart=%s" % (('false', 'true)[options.e10s]))
 
     # get extensions to install
     extensions = self.getExtensionsToInstall(options)
@@ -847,8 +869,10 @@ class Mochitest(MochitestUtilsMixin):
     # web apps
     appsPath = os.path.join(SCRIPT_DIR, 'profile_data', 'webapps_mochitest.json')
     if os.path.exists(appsPath):
-      with open(appsPath) as apps_file:
+      apps_file = open(appsPath)
+      if 1:
         apps = json.load(apps_file)
+      apps_file.close()
     else:
       apps = None
 
@@ -997,13 +1021,15 @@ class Mochitest(MochitestUtilsMixin):
     log.info('INFO | zombiecheck | Reading PID log: %s', processLog)
     processList = []
     pidRE = re.compile(r'launched child process (\d+)$')
-    with open(processLog) as processLogFD:
+    processLogFD = open(processLog)
+    if 1:
       for line in processLogFD:
         log.info(line.rstrip())
         m = pidRE.search(line)
         if m:
           processList.append(int(m.group(1)))
 
+    processLogFD.close()
     # kill zombies
     foundZombie = False
     for processPID in processList:
@@ -1305,11 +1331,13 @@ class Mochitest(MochitestUtilsMixin):
     processLeakLog(self.leak_report_file, options.leakThreshold)
 
     if self.nsprLogs:
-      with zipfile.ZipFile("%s/nsprlog.zip" % browserEnv["MOZ_UPLOAD_DIR"], "w", zipfile.ZIP_DEFLATED) as logzip:
+      logzip = zipfile.ZipFile("%s/nsprlog.zip" % browserEnv["MOZ_UPLOAD_DIR"], "w", zipfile.ZIP_DEFLATED).__enter__()
+      if 1:
         for logfile in glob.glob("%s/nspr*.log*" % tempfile.gettempdir()):
           logzip.write(logfile)
           os.remove(logfile)
 
+      logzip.__exit__(0, 0, 0)
     log.info("runtests.py | Running tests: end.")
 
     if manifest is not None:
@@ -1505,9 +1533,11 @@ class Mochitest(MochitestUtilsMixin):
     d['testRoot'] = testRoot
     content = json.dumps(d)
 
-    with open(os.path.join(options.profilePath, "testConfig.js"), "w") as config:
+    config = open(os.path.join(options.profilePath, "testConfig.js"), "w")
+    if 1:
       config.write(content)
 
+    config.close()
   def installExtensionFromPath(self, options, path, extensionID = None):
     """install an extension to options.profilePath"""
 
diff -up mozilla-esr31/testing/mochitest/runtestsremote.py.python3 mozilla-esr31/testing/mochitest/runtestsremote.py
--- mozilla-esr31/testing/mochitest/runtestsremote.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mochitest/runtestsremote.py	2014-09-05 15:26:14.103681163 +0200
@@ -407,9 +407,11 @@ class MochiRemote(Mochitest):
 
     # In the future we could use LogParser: http://hg.mozilla.org/automation/logparser/
     def addLogData(self):
-        with open(self.localLog) as currentLog:
+        currentLog = open(self.localLog)
+        if 1:
             data = currentLog.readlines()
 
+        currentLog.close()
         restart = re.compile('0 INFO SimpleTest START.*')
         reend = re.compile('([0-9]+) INFO TEST-START . Shutdown.*')
         refail = re.compile('([0-9]+) INFO TEST-UNEXPECTED-FAIL.*')
@@ -466,9 +468,11 @@ class MochiRemote(Mochitest):
 
         # TODO: Consider not printing to stdout because we might be duplicating output
         print '\n'.join(logFile)
-        with open(self.localLog, 'w') as localLog:
+        localLog = open(self.localLog, 'w')
+        if 1:
             localLog.write('\n'.join(logFile))
 
+        localLog.close()
         if failed > 0:
             return 1
         return 0
diff -up mozilla-esr31/testing/mozbase/manifestdestiny/manifestparser/manifestparser.py.python3 mozilla-esr31/testing/mozbase/manifestdestiny/manifestparser/manifestparser.py
--- mozilla-esr31/testing/mozbase/manifestdestiny/manifestparser/manifestparser.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/manifestdestiny/manifestparser/manifestparser.py	2014-09-05 15:26:14.103681163 +0200
@@ -14,7 +14,7 @@ __all__ = ['read_ini', # .ini reader
 
 import fnmatch
 import os
-import re
+import re, sre
 import shutil
 import sys
 
@@ -258,12 +258,13 @@ class ExpressionParser(object):
         passed to the constructor. Raises a ParseError if the expression
         could not be parsed.
         """
-        try:
+        #try:
+        if 1:
             self.iter = self._tokenize()
             self.token = self.iter.next()
             return self.expression()
-        except:
-            raise ParseError("could not parse: %s; variables: %s" % (self.text, self.valuemapping))
+        #except:
+        #    raise ParseError("could not parse: %s; variables: %s" % (self.text, self.valuemapping))
 
     __call__ = parse
 
@@ -318,7 +319,7 @@ def read_ini(fp, variables=None, default
         fp = file(fp)
 
     # read the lines
-    for (linenum, line) in enumerate(fp.readlines(), start=1):
+    for (linenum, line) in enumerate(fp.readlines()):
 
         stripped = line.strip()
 
@@ -385,7 +386,7 @@ def read_ini(fp, variables=None, default
                 else:
                     filename = 'unknown'
                 raise Exception("Error parsing manifest file '%s', line %s" %
-                                (filename, linenum))
+                                (filename, linenum+1))
 
     # interpret the variables
     def interpret_variables(global_dict, local_dict):
@@ -961,12 +962,14 @@ class ManifestParser(object):
 
             manifest_path = os.path.join(dirpath, filename)
             if (dirnames or filenames) and not (os.path.exists(manifest_path) and overwrite):
-                with file(manifest_path, 'w') as manifest:
+                manifest = file(manifest_path, 'w').__enter__()
+                if 1:
                     for dirname in dirnames:
                         print >> manifest, '[include:%s]' % os.path.join(dirname, filename)
                     for _filename in filenames:
                         print >> manifest, '[%s]' % _filename
 
+                manifest.__exit__(0, 0, 0)
                 # add to list of manifests
                 manifest_dict.setdefault(directory, manifest_path)
 
diff -up mozilla-esr31/testing/mozbase/manifestdestiny/tests/test_convert_directory.py.python3 mozilla-esr31/testing/mozbase/manifestdestiny/tests/test_convert_directory.py
--- mozilla-esr31/testing/mozbase/manifestdestiny/tests/test_convert_directory.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/manifestdestiny/tests/test_convert_directory.py	2014-09-05 15:26:14.103681163 +0200
@@ -136,9 +136,11 @@ subsuite =
         newtempdir = tempfile.mkdtemp()
         manifest_file = os.path.join(newtempdir, 'manifest.ini')
         manifest_contents = str(convert([tempdir], relative_to=tempdir))
-        with file(manifest_file, 'w') as f:
+        f = file(manifest_file, 'w').__enter__()
+        if 1:
             f.write(manifest_contents)
 
+        f.__exit__(0, 0, 0)
         # get the manifest
         manifest = ManifestParser(manifests=(manifest_file,))
 
diff -up mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py.python3 mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
--- mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py	2014-09-05 15:26:14.103681163 +0200
@@ -579,7 +579,8 @@ class DeviceManagerADB(DeviceManager):
 
         timeout = int(timeout)
         retries = 0
-        with tempfile.SpooledTemporaryFile() as procOut:
+        procOut = tempfile.SpooledTemporaryFile().__enter__()
+        if 1:
             while retries < retryLimit:
                 proc = subprocess.Popen(finalArgs, stdout=procOut, stderr=subprocess.STDOUT)
                 start_time = time.time()
@@ -592,6 +593,7 @@ class DeviceManagerADB(DeviceManager):
                     retries += 1
                     continue
                 return ret_code
+        procOut.__exit__(0, 0, 0)
         raise DMError("Timeout exceeded for _checkCmd call after %d retries." % retries)
 
     def chmodDir(self, remoteDir, mask="777"):
diff -up mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanager.py.python3 mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanager.py
--- mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanager.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanager.py	2014-09-05 15:26:14.104681168 +0200
@@ -72,7 +72,11 @@ class DeviceManager(object):
     @debug.setter
     def debug_setter(self, newDebug):
         self._logger.warn("dm.debug is deprecated. Use logLevel.")
-        newDebug = 5 if newDebug > 5 else newDebug # truncate >=5 to 5
+        newDebug = None
+        if newDebug > 5:
+          newDebug = 5
+        else:
+          newDebug = newDebug # truncate >=5 to 5
         levels = {5: mozlog.DEBUG, 3: mozlog.INFO, 2: mozlog.WARNING,
                   1: mozlog.ERROR, 0: mozlog.CRITICAL}
         self.logLevel = levels[newDebug]
@@ -154,7 +158,8 @@ class DeviceManager(object):
         if not self.fileExists(screencap):
             raise DMError("Unable to capture screenshot on device: no screencap utility")
 
-        with open(filename, 'w') as pngfile:
+        pngfile = open(filename, 'w')
+        if 1:
             # newer versions of screencap can write directly to a png, but some
             # older versions can't
             tempScreenshotFile = self.getDeviceRoot() + "/ss-dm.tmp"
@@ -164,10 +169,13 @@ class DeviceManager(object):
             buf = self.pullFile(tempScreenshotFile)
             width = int(struct.unpack("I", buf[0:4])[0])
             height = int(struct.unpack("I", buf[4:8])[0])
-            with open(filename, 'w') as pngfile:
+            pngfile = open(filename, 'w')
+            if 1:
                 pngfile.write(self._writePNG(buf[12:], width, height))
+            pngfile.close()
             self.removeFile(tempScreenshotFile)
 
+        pngfile.close()
     @abstractmethod
     def pushFile(self, localFilename, remoteFilename, retryLimit=1, createDir=True):
         """
@@ -511,11 +519,11 @@ class DeviceManager(object):
         """
         # Based on: http://code.activestate.com/recipes/577443-write-a-png-image-in-native-python/
         width_byte_4 = width * 4
-        raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range(0, (height - 1) * width * 4, width_byte_4))
+        raw_data = "".join(b'\x00' + buf[span:span + width_byte_4] for span in range(0, (height - 1) * width * 4, width_byte_4))
         def png_pack(png_tag, data):
             chunk_head = png_tag + data
             return struct.pack("!I", len(data)) + chunk_head + struct.pack("!I", 0xFFFFFFFF & zlib.crc32(chunk_head))
-        return b"".join([
+        return "".join([
                 b'\x89PNG\r\n\x1a\n',
                 png_pack(b'IHDR', struct.pack("!2I5B", width, height, 8, 6, 0, 0, 0)),
                 png_pack(b'IDAT', zlib.compress(raw_data, 9)),
diff -up mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py.python3 mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py
--- mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py	2014-09-05 15:26:14.104681168 +0200
@@ -119,8 +119,7 @@ class DeviceManagerSUT(DeviceManager):
         """
         # this allows us to move the retry logic outside of the _doCmds() to make it
         # easier for debugging in the future.
-        # note that since cmdlist is a list of commands, they will all be retried if
-        # one fails.  this is necessary in particular for pushFile(), where we don't want
+        # note that since cmdlist is a list of commands, they will all be retried if # one fails.  this is necessary in particular for pushFile(), where we don't want
         # to accidentally send extra data if a failure occurs during data transmission.
 
         retryLimit = retryLimit or self.retryLimit
@@ -347,9 +346,11 @@ class DeviceManagerSUT(DeviceManager):
 
         try:
             filesize = os.path.getsize(localname)
-            with open(localname, 'rb') as f:
+            f = open(localname, 'rb')
+            if 1:
                 remoteHash = self._runCmds([{ 'cmd': 'push ' + destname + ' ' + str(filesize),
                                               'data': f.read() }], retryLimit=retryLimit).strip()
+            f.close()
         except OSError:
             raise DMError("DeviceManager: Error reading file to push")
 
diff -up mozilla-esr31/testing/mozbase/mozdevice/mozdevice/droid.py.python3 mozilla-esr31/testing/mozbase/mozdevice/mozdevice/droid.py
--- mozilla-esr31/testing/mozbase/mozdevice/mozdevice/droid.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/mozdevice/droid.py	2014-09-05 15:26:14.104681168 +0200
@@ -42,7 +42,7 @@ class DroidMixin(object):
                           "at once")
 
         acmd = [ "am", "start" ] + self._getExtraAmStartArgs() + \
-            ["-W" if wait else '', "-n", "%s/%s" % (appName, activityName)]
+            [('', "-W")[wait], "-n", "%s/%s" % (appName, activityName)]
 
         if intent:
             acmd.extend(["-a", intent])
diff -up mozilla-esr31/testing/mozbase/mozdevice/mozdevice/sutini.py.python3 mozilla-esr31/testing/mozbase/mozdevice/mozdevice/sutini.py
--- mozilla-esr31/testing/mozbase/mozdevice/mozdevice/sutini.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/mozdevice/sutini.py	2014-09-05 15:26:14.104681168 +0200
@@ -70,7 +70,7 @@ def set_opt(cfg, s, o, dflt):
 
 def bool_query(prompt, dflt):
     while True:
-        i = raw_input('%s [%s] ' % (prompt, 'y' if dflt else 'n')).lower()
+        i = raw_input('%s [%s] ' % (prompt, ('n', 'y')[dflt])).lower()
         if not i or i[0] in ('y', 'n'):
             break
         print 'Enter y or n.'
diff -up mozilla-esr31/testing/mozbase/mozdevice/mozdevice/Zeroconf.py.python3 mozilla-esr31/testing/mozbase/mozdevice/mozdevice/Zeroconf.py
--- mozilla-esr31/testing/mozbase/mozdevice/mozdevice/Zeroconf.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/mozdevice/Zeroconf.py	2014-09-05 15:26:14.104681168 +0200
@@ -1470,8 +1470,7 @@ class Zeroconf(object):
             self.updateRecord(now, record)
 
     def handleQuery(self, msg, addr, port):
-        """Deal with incoming query packets.  Provides a response if
-        possible."""
+        """Deal with incoming query packets.  Provides a response if possible."""
         out = None
 
         # Support unicast client responses
diff -up mozilla-esr31/testing/mozbase/mozdevice/sut_tests/genfiles.py.python3 mozilla-esr31/testing/mozbase/mozdevice/sut_tests/genfiles.py
--- mozilla-esr31/testing/mozbase/mozdevice/sut_tests/genfiles.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/sut_tests/genfiles.py	2014-09-05 15:26:14.104681168 +0200
@@ -10,19 +10,23 @@ import shutil
 
 
 def gen_binary_file(path, size):
-    with open(path, 'wb') as f:
+    f = open(path, 'wb')
+    if 1:
         for i in xrange(size):
             byte = '%c' % randint(0, 255)
             f.write(byte)
 
 
+    f.close()
 def gen_zip(path, files, stripped_prefix=''):
-    with ZipFile(path, 'w') as z:
+    z = ZipFile(path, 'w').__enter__()
+    if 1:
         for f in files:
             new_name = f.replace(stripped_prefix, '')
             z.write(f, new_name)
 
 
+    z.__exit__(0, 0, 0)
 def mkdir(path, *args):
     try:
         os.mkdir(path, *args)
diff -up mozilla-esr31/testing/mozbase/mozdevice/sut_tests/test_fileExists.py.python3 mozilla-esr31/testing/mozbase/mozdevice/sut_tests/test_fileExists.py
--- mozilla-esr31/testing/mozbase/mozdevice/sut_tests/test_fileExists.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/sut_tests/test_fileExists.py	2014-09-05 15:26:14.105681173 +0200
@@ -20,8 +20,10 @@ class FileExistsTestCase(DeviceManagerTe
     def testOnRegularFile(self):
         remote_path = posixpath.join(self.dm.getDeviceRoot(), 'testFile')
         self.assertFalse(self.dm.fileExists(remote_path))
-        with tempfile.NamedTemporaryFile() as f:
+        f = tempfile.NamedTemporaryFile().__enter__()
+        if 1:
             self.dm.pushFile(f.name, remote_path)
+        f.__exit__(0, 0, 0)
         self.assertTrue(self.dm.fileExists(remote_path))
         self.dm.removeFile(remote_path)
 
@@ -29,8 +31,10 @@ class FileExistsTestCase(DeviceManagerTe
         remote_path = posixpath.join(self.dm.getDeviceRoot(), 'testDir')
         remote_path_file = posixpath.join(remote_path, 'testFile')
         self.assertFalse(self.dm.fileExists(remote_path))
-        with tempfile.NamedTemporaryFile() as f:
+        f = tempfile.NamedTemporaryFile().__enter__()
+        if 1:
             self.dm.pushFile(f.name, remote_path_file)
+        f.__exit__(0, 0, 0)
         self.assertTrue(self.dm.fileExists(remote_path))
         self.dm.removeFile(remote_path_file)
         self.dm.removeDir(remote_path)
diff -up mozilla-esr31/testing/mozbase/mozdevice/tests/sut_fileMethods.py.python3 mozilla-esr31/testing/mozbase/mozdevice/tests/sut_fileMethods.py
--- mozilla-esr31/testing/mozbase/mozdevice/tests/sut_fileMethods.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/tests/sut_fileMethods.py	2014-09-05 15:26:14.105681173 +0200
@@ -21,7 +21,8 @@ class TestFileMethods(unittest.TestCase)
 
     def test_validateFile(self):
 
-        with tempfile.NamedTemporaryFile() as f:
+        f = tempfile.NamedTemporaryFile().__enter__()
+        if 1:
             f.write(self.content)
             f.flush()
 
@@ -39,18 +40,21 @@ class TestFileMethods(unittest.TestCase)
             d = mozdevice.DroidSUT("127.0.0.1", port=m.port, logLevel=mozlog.DEBUG)
             self.assertFalse(d.validateFile('/sdcard/test/file', f.name))
 
+        f.__exit__(0, 0, 0)
     def test_getFile(self):
 
         fname = "/mnt/sdcard/file"
         commands = [("pull %s" % fname, "%s,%s\n%s" % (fname, len(self.content), self.content)),
                     ("hash %s" % fname, self.temp_hash)]
 
-        with tempfile.NamedTemporaryFile() as f:
+        f = tempfile.NamedTemporaryFile().__enter__()
+        if 1:
             m = MockAgent(self, commands=commands)
             d = mozdevice.DroidSUT("127.0.0.1", port=m.port, logLevel=mozlog.DEBUG)
             # No error means success
             self.assertEqual(None, d.getFile(fname, f.name))
 
+        f.__exit__(0, 0, 0)
     def test_getDirectory(self):
 
         fname = "/mnt/sdcard/file"
diff -up mozilla-esr31/testing/mozbase/mozdevice/tests/sut_push.py.python3 mozilla-esr31/testing/mozbase/mozdevice/tests/sut_push.py
--- mozilla-esr31/testing/mozbase/mozdevice/tests/sut_push.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozdevice/tests/sut_push.py	2014-09-05 15:26:14.105681173 +0200
@@ -20,7 +20,8 @@ class PushTest(unittest.TestCase):
             a = MockAgent(self, commands = [("isdir /mnt/sdcard", "TRUE"),
                                             (cmd, response[0])])
             exceptionThrown = False
-            with tempfile.NamedTemporaryFile() as f:
+            f = tempfile.NamedTemporaryFile().__enter__()
+            if 1:
                 try:
                     f.write(pushfile)
                     f.flush()
@@ -29,6 +30,7 @@ class PushTest(unittest.TestCase):
                 except mozdevice.DMError, e:
                     exceptionThrown = True
                 self.assertEqual(exceptionThrown, response[1])
+            f.__exit__(0, 0, 0)
             a.wait()
 
     def test_push_dir(self):
diff -up mozilla-esr31/testing/mozbase/mozfile/mozfile/mozfile.py.python3 mozilla-esr31/testing/mozbase/mozfile/mozfile/mozfile.py
--- mozilla-esr31/testing/mozbase/mozfile/mozfile/mozfile.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozfile/mozfile/mozfile.py	2014-09-05 15:26:14.105681173 +0200
@@ -4,7 +4,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from contextlib import contextmanager
+
 import errno
 import os
 import shutil
@@ -287,12 +287,12 @@ def tree(directory,
         # if the top-level entry directory, print as passed
         retval.append('%s%s%s'% (''.join(indent[:-1]),
                                  dirpath_mark,
-                                 basename if retval else directory))
+                                 (directory, basename)[retval]))
         # add the files
         if filenames:
             last_file = filenames[-1]
             retval.extend([('%s%s%s' % (''.join(indent),
-                                        files_end if filename == last_file else item_marker,
+                                        (item_marker, files_end)[filename == last_file],
                                         filename))
                                         for index, filename in enumerate(filenames)])
 
@@ -312,11 +312,13 @@ class NamedTemporaryFile(object):
 
     Example usage:
 
-    with NamedTemporaryFile() as fh:
+    fh = NamedTemporaryFile().__enter__()
+    if 1:
         fh.write(b'foobar')
 
         print('Filename: %s' % fh.name)
 
+    fh.__exit__(0, 0, 0)
     see https://bugzilla.mozilla.org/show_bug.cgi?id=821362
     """
     def __init__(self, mode='w+b', bufsize=-1, suffix='', prefix='tmp',
@@ -354,21 +356,23 @@ class NamedTemporaryFile(object):
             os.unlink(self.__dict__['_path'])
 
 
-@contextmanager
+#@contextmanager
 def TemporaryDirectory():
     """
     create a temporary directory using tempfile.mkdtemp, and then clean it up.
 
     Example usage:
-    with TemporaryDirectory() as tmp:
+    tmp = TemporaryDirectory().__enter__()
+    if 1:
        open(os.path.join(tmp, "a_temp_file"), "w").write("data")
 
+    tmp.__exit__(0, 0, 0)
     """
     tempdir = tempfile.mkdtemp()
-    try:
-        yield tempdir
-    finally:
-        shutil.rmtree(tempdir)
+    #try:
+    yield tempdir
+    #finally:
+    shutil.rmtree(tempdir)
 
 
 ### utilities dealing with URLs
diff -up mozilla-esr31/testing/mozbase/mozfile/tests/test_remove.py.python3 mozilla-esr31/testing/mozbase/mozfile/tests/test_remove.py
--- mozilla-esr31/testing/mozbase/mozfile/tests/test_remove.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozfile/tests/test_remove.py	2014-09-05 15:26:14.105681173 +0200
@@ -32,8 +32,10 @@ class FileOpenCloseThread(threading.Thre
         self.delete = delete
 
     def run(self):
-        with open(self.path) as f:
+        f = open(self.path)
+        if 1:
             time.sleep(self.delay)
+        f.__exit__(0, 0, 0)
         if self.delete:
             try:
                 os.remove(self.path)
@@ -79,9 +81,11 @@ class MozfileRemoveTestCase(unittest.Tes
         """Test removing a closed file"""
         # Open a file in the generated stub
         filepath = os.path.join(self.tempdir, *stubs.files[1])
-        with open(filepath, 'w') as f:
+        f = open(filepath, 'w').__enter__()
+        if 1:
             f.write('foo-bar')
 
+        f.close()
         # Folder should be deleted on all platforms
         mozfile.remove(self.tempdir)
         self.assertFalse(os.path.exists(self.tempdir))
diff -up mozilla-esr31/testing/mozbase/mozfile/tests/test_tempdir.py.python3 mozilla-esr31/testing/mozbase/mozfile/tests/test_tempdir.py
--- mozilla-esr31/testing/mozbase/mozfile/tests/test_tempdir.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozfile/tests/test_tempdir.py	2014-09-05 15:26:14.105681173 +0200
@@ -18,23 +18,29 @@ class TestTemporaryDirectory(unittest.Te
     def test_removed(self):
         """ensure that a TemporaryDirectory gets removed"""
         path = None
-        with TemporaryDirectory() as tmp:
+        tmp = TemporaryDirectory().__enter__()
+        if 1:
             path = tmp
             self.assertTrue(os.path.isdir(tmp))
             tmpfile = os.path.join(tmp, "a_temp_file")
             open(tmpfile, "w").write("data")
             self.assertTrue(os.path.isfile(tmpfile))
+        tmp.__exit__(0, 0, 0)
         self.assertFalse(os.path.isdir(path))
         self.assertFalse(os.path.exists(path))
 
     def test_exception(self):
         """ensure that TemporaryDirectory handles exceptions"""
         path = None
-        with self.assertRaises(Exception):
-            with TemporaryDirectory() as tmp:
+        self.assertRaises(Exception).__enter__()
+        if 1:
+            tmp = TemporaryDirectory().__enter__()
+            if 1:
                 path = tmp
                 self.assertTrue(os.path.isdir(tmp))
                 raise Exception("oops")
+            tmp.__exit__(0, 0, 0)
+        self.assertRaises(Exception).__exit__(0, 0, 0)
         self.assertFalse(os.path.isdir(path))
         self.assertFalse(os.path.exists(path))
 
diff -up mozilla-esr31/testing/mozbase/mozfile/tests/test_tempfile.py.python3 mozilla-esr31/testing/mozbase/mozfile/tests/test_tempfile.py
--- mozilla-esr31/testing/mozbase/mozfile/tests/test_tempfile.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozfile/tests/test_tempfile.py	2014-09-05 15:26:14.105681173 +0200
@@ -24,7 +24,8 @@ class TestNamedTemporaryFile(unittest.Te
         """
 
         test_string = "A simple test"
-        with mozfile.NamedTemporaryFile() as temp:
+        temp = mozfile.NamedTemporaryFile().__enter__()
+        if 1:
             # Test we can write to file
             temp.write(test_string)
             # Forced flush, so that we can read later
@@ -33,6 +34,7 @@ class TestNamedTemporaryFile(unittest.Te
             # Test we can open the file again on all platforms
             self.assertEqual(open(temp.name).read(), test_string)
 
+        temp.__exit__(0, 0, 0)
     def test_iteration(self):
         """ensure the line iterator works"""
 
@@ -64,8 +66,10 @@ class TestNamedTemporaryFile(unittest.Te
 
         # make a deleteable file; ensure it gets cleaned up
         path = None
-        with mozfile.NamedTemporaryFile(delete=True) as tf:
+        tf = mozfile.NamedTemporaryFile(delete=True).__enter__()
+        if 1:
             path = tf.name
+        tf.__exit__(0, 0, 0)
         self.assertTrue(isinstance(path, basestring))
         self.assertFalse(os.path.exists(path))
 
@@ -80,8 +84,10 @@ class TestNamedTemporaryFile(unittest.Te
         # Now the same thing but we won't delete the file
         path = None
         try:
-            with mozfile.NamedTemporaryFile(delete=False) as tf:
+            tf = mozfile.NamedTemporaryFile(delete=False).__enter__()
+            if 1:
                 path = tf.name
+            tf.__exit__(0, 0, 0)
             self.assertTrue(os.path.exists(path))
         finally:
             if path and os.path.exists(path):
diff -up mozilla-esr31/testing/mozbase/mozhttpd/mozhttpd/mozhttpd.py.python3 mozilla-esr31/testing/mozbase/mozhttpd/mozhttpd/mozhttpd.py
--- mozilla-esr31/testing/mozbase/mozhttpd/mozhttpd/mozhttpd.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozhttpd/mozhttpd/mozhttpd.py	2014-09-05 15:26:14.105681173 +0200
@@ -213,8 +213,7 @@ class MozHttpd(object):
     from <self.docroot>/<host>/.
 
     For example, the request "GET http://foo.bar/dir/file.html" would
-    (assuming no handlers match) serve <docroot>/dir/file.html if
-    proxy_host_dirs is False, or <docroot>/foo.bar/dir/file.html if it is
+    (assuming no handlers match) serve <docroot>/dir/file.html if proxy_host_dirs is False, or <docroot>/foo.bar/dir/file.html if it is
     True.
     """
 
diff -up mozilla-esr31/testing/mozbase/mozhttpd/tests/basic.py.python3 mozilla-esr31/testing/mozbase/mozhttpd/tests/basic.py
--- mozilla-esr31/testing/mozbase/mozhttpd/tests/basic.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozhttpd/tests/basic.py	2014-09-05 15:26:14.106681178 +0200
@@ -27,9 +27,11 @@ class TestBasic(unittest.TestCase):
             sizes[k].append(fpath)
 
             # Write binary string to file
-            with open(fpath, 'wb') as f:
+            f = open(fpath, 'wb')
+            if 1:
                 f.write(sizes[k][1])
 
+            f.close()
         server = mozhttpd.MozHttpd(docroot=tempdir)
         server.start()
         server_url = server.get_url()
diff -up mozilla-esr31/testing/mozbase/mozhttpd/tests/paths.py.python3 mozilla-esr31/testing/mozbase/mozhttpd/tests/paths.py
--- mozilla-esr31/testing/mozbase/mozhttpd/tests/paths.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozhttpd/tests/paths.py	2014-09-05 15:26:14.106681178 +0200
@@ -16,13 +16,16 @@ class PathTest(unittest.TestCase):
         self.assertEqual(f.read(), expected_contents)
 
     def try_get_expect_404(self, url):
-        with self.assertRaises(urllib2.HTTPError) as cm:
+        cm = self.assertRaises(urllib2.HTTPError).__enter__()
+        if 1:
             urllib2.urlopen(url)
+        cm.__exit__(0, 0, 0)
         self.assertEqual(404, cm.exception.code)
 
     def test_basic(self):
         """Test that requests to docroot and a path mapping work as expected."""
-        with TemporaryDirectory() as d1, TemporaryDirectory() as d2:
+        d1, TemporaryDirectory() = d2 = TemporaryDirectory().__enter__()
+        if 1:
             open(os.path.join(d1, "test1.txt"), "w").write("test 1 contents")
             open(os.path.join(d2, "test2.txt"), "w").write("test 2 contents")
             httpd = mozhttpd.MozHttpd(port=0,
@@ -35,9 +38,11 @@ class PathTest(unittest.TestCase):
             self.try_get_expect_404(httpd.get_url("/files/test2_nope.txt"))
             httpd.stop()
 
+        d2.__exit__(0, 0, 0)
     def test_substring_mappings(self):
         """Test that a path mapping that's a substring of another works."""
-        with TemporaryDirectory() as d1, TemporaryDirectory() as d2:
+        d1, TemporaryDirectory() = d2 = TemporaryDirectory().__enter__()
+        if 1:
             open(os.path.join(d1, "test1.txt"), "w").write("test 1 contents")
             open(os.path.join(d2, "test2.txt"), "w").write("test 2 contents")
             httpd = mozhttpd.MozHttpd(port=0,
@@ -49,9 +54,11 @@ class PathTest(unittest.TestCase):
             self.try_get(httpd.get_url("/abc/test2.txt"), "test 2 contents")
             httpd.stop()
 
+        d2.__exit__(0, 0, 0)
     def test_multipart_path_mapping(self):
         """Test that a path mapping with multiple directories works."""
-        with TemporaryDirectory() as d1:
+        d1 = TemporaryDirectory().__enter__()
+        if 1:
             open(os.path.join(d1, "test1.txt"), "w").write("test 1 contents")
             httpd = mozhttpd.MozHttpd(port=0,
                                       path_mappings={'/abc/def/ghi': d1}
@@ -62,14 +69,17 @@ class PathTest(unittest.TestCase):
             self.try_get_expect_404(httpd.get_url("/abc/def/test1.txt"))
             httpd.stop()
 
+        d1.__exit__(0, 0, 0)
     def test_no_docroot(self):
         """Test that path mappings with no docroot work."""
-        with TemporaryDirectory() as d1:
+        d1 = TemporaryDirectory().__enter__()
+        if 1:
             httpd = mozhttpd.MozHttpd(port=0,
                                       path_mappings={'/foo': d1})
             httpd.start(block=False)
             self.try_get_expect_404(httpd.get_url())
             httpd.stop()
 
+        d1.__exit__(0, 0, 0)
 if __name__ == '__main__':
     unittest.main()
diff -up mozilla-esr31/testing/mozbase/mozinfo/tests/test.py.python3 mozilla-esr31/testing/mozbase/mozinfo/tests/test.py
--- mozilla-esr31/testing/mozbase/mozinfo/tests/test.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozinfo/tests/test.py	2014-09-05 15:26:14.106681178 +0200
@@ -41,24 +41,30 @@ class TestMozinfo(unittest.TestCase):
     def test_update_file(self):
         """Test that mozinfo.update can load a JSON file."""
         j = os.path.join(self.tempdir, "mozinfo.json")
-        with open(j, "w") as f:
+        f = open(j, "w")
+        if 1:
             f.write(json.dumps({"foo": "xyz"}))
+        f.__exit__(0, 0, 0)
         mozinfo.update(j)
         self.assertEqual(mozinfo.info["foo"], "xyz")
 
     def test_update_file_invalid_json(self):
         """Test that mozinfo.update handles invalid JSON correctly"""
         j = os.path.join(self.tempdir,'test.json')
-        with open(j, 'w') as f:
+        f = open(j, 'w')
+        if 1:
             f.write('invalid{"json":')
+        f.__exit__(0, 0, 0)
         self.assertRaises(ValueError,mozinfo.update,[j])
 
     def test_find_and_update_file(self):
         """Test that mozinfo.find_and_update_from_json can
         find mozinfo.json in a directory passed to it."""
         j = os.path.join(self.tempdir, "mozinfo.json")
-        with open(j, "w") as f:
+        f = open(j, "w").__enter__()
+        if 1:
             f.write(json.dumps({"foo": "abcdefg"}))
+        f.__exit__(0, 0, 0)
         self.assertEqual(mozinfo.find_and_update_from_json(self.tempdir), j)
         self.assertEqual(mozinfo.info["foo"], "abcdefg")
 
@@ -66,8 +72,10 @@ class TestMozinfo(unittest.TestCase):
         """Test that mozinfo.find_and_update_from_json can
         handle invalid JSON"""
         j = os.path.join(self.tempdir, "mozinfo.json")
-        with open(j, 'w') as f:
+        f = open(j, 'w').__enter__()
+        if 1:
             f.write('invalid{"json":')
+        f.close()
         self.assertRaises(ValueError, mozinfo.find_and_update_from_json, self.tempdir)
 
 
@@ -75,13 +83,17 @@ class TestMozinfo(unittest.TestCase):
         """Test that mozinfo.find_and_update_from_json can
         find mozinfo.json using the mozbuild module."""
         j = os.path.join(self.tempdir, "mozinfo.json")
-        with open(j, "w") as f:
+        f = open(j, "w").__enter__()
+        if 1:
             f.write(json.dumps({"foo": "123456"}))
+        f.close()
         m = mock.MagicMock()
         # Mock the value of MozbuildObject.from_environment().topobjdir.
         m.MozbuildObject.from_environment.return_value.topobjdir = self.tempdir
-        with mock.patch.dict(sys.modules, {"mozbuild": m, "mozbuild.base": m}):
+        mock.patch.dict(sys.modules, {"mozbuild": m, "mozbuild.base": m}).__enter__()
+        if 1:
             self.assertEqual(mozinfo.find_and_update_from_json(), j)
+        mock.patch.dict(sys.modules, {"mozbuild": m, "mozbuild.base": m}).__exit__(0, 0, 0)
         self.assertEqual(mozinfo.info["foo"], "123456")
 
 if __name__ == '__main__':
diff -up mozilla-esr31/testing/mozbase/mozlog/mozlog/logger.py.python3 mozilla-esr31/testing/mozbase/mozlog/mozlog/logger.py
--- mozilla-esr31/testing/mozbase/mozlog/mozlog/logger.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozlog/mozlog/logger.py	2014-09-05 15:26:14.106681178 +0200
@@ -72,8 +72,7 @@ class MozLogger(_LoggerClass):
 
             # If the logger is fed a level number unknown to the logging
             # module, getLevelName will return a string. Unfortunately,
-            # the logging module will raise a type error elsewhere if
-            # the level is not an integer.
+            # the logging module will raise a type error elsewhere if # the level is not an integer.
             if not isinstance(level, int):
                 level = _default_level
 
diff -up mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py.python3 mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py
--- mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py	2014-09-05 15:26:14.106681178 +0200
@@ -38,12 +38,14 @@ class HTMLFormatter(base.BaseFormatter):
     def suite_start(self, data):
         self.suite_times["start"] = data["time"]
         self.suite_name = data["source"]
-        with open(os.path.join(base_path, "style.css")) as f:
+        f = open(os.path.join(base_path, "style.css"))
+        if 1:
             self.head = html.head(
                 html.meta(charset="utf-8"),
                 html.title(data["source"]),
                 html.style(raw(f.read())))
 
+        f.close()
     def suite_end(self, data):
         self.suite_times["end"] = data["time"]
         return self.generate_html()
@@ -123,7 +125,8 @@ class HTMLFormatter(base.BaseFormatter):
 
     def generate_html(self):
         generated = datetime.datetime.now()
-        with open(os.path.join(base_path, "main.js")) as main_f:
+        main_f = open(os.path.join(base_path, "main.js"))
+        if 1:
             doc = html.html(
                 self.head,
                 html.body(
@@ -157,6 +160,7 @@ class HTMLFormatter(base.BaseFormatter):
                             html.th('Links')]), id='results-table-head'),
                         html.tbody(self.result_rows, id='results-table-body')], id='results-table'))))
 
+        main_f.close()
         return doc.unicode(indent=2)
 
 
diff -up mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py.python3 mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
--- mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py	2014-09-05 15:26:14.106681178 +0200
@@ -53,7 +53,11 @@ class BaseMachFormatter(base.BaseFormatt
             expected_str = ""
 
         subtests = self._get_subtest_data(data)
-        unexpected = subtests["unexpected"] + (1 if "expected" in data else 0)
+        unexpected = None
+        if "expected" in data:
+          unexpected = subtests["unexpected"] + (1
+        else:
+          unexpected = 0)
 
         return "Harness status %s%s. Subtests passed %i/%i. Unexpected %i" % (
             data["status"], expected_str, subtests["pass"],
diff -up mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/handlers/__init__.py.python3 mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/handlers/__init__.py
--- mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/handlers/__init__.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/handlers/__init__.py	2014-09-05 15:26:14.106681178 +0200
@@ -60,10 +60,13 @@ class StreamHandler(BaseHandler):
         formatted = self.formatter(data)
         if not formatted:
             return
-        with self._lock:
+        self._lock.__enter__()
+        if 1:
             #XXX Should encoding be the formatter's responsibility?
             try:
                 self.stream.write(formatted.encode("utf8"))
             except:
                 raise
             self.stream.flush()
+        self._lock.__exit__(0, 0, 0)
+
diff -up mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/structuredlog.py.python3 mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/structuredlog.py
--- mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/structuredlog.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozlog/mozlog/structured/structuredlog.py	2014-09-05 15:26:14.106681178 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import sys
 from collections import defaultdict
@@ -90,11 +90,13 @@ class StructuredLogger(object):
     def _log_data(self, action, data=None):
         if data is None:
             data = {}
-        with self._lock:
+        self._lock.__enter__()
+        if 1:
             log_data = self._make_log_data(action, data)
             for handler in self.handlers:
                 handler(log_data)
 
+        self._lock.__exit__(0, 0, 0)
     def _make_log_data(self, action, data):
         all_data = {"action": action,
                     "time": int(time.time() * 1000),
diff -up mozilla-esr31/testing/mozbase/moznetwork/moznetwork/moznetwork.py.python3 mozilla-esr31/testing/mozbase/moznetwork/moznetwork/moznetwork.py
--- mozilla-esr31/testing/mozbase/moznetwork/moznetwork/moznetwork.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/moznetwork/moznetwork/moznetwork.py	2014-09-05 15:26:14.107681183 +0200
@@ -22,7 +22,11 @@ def _get_interface_list():
     max_iface = 32  # Maximum number of interfaces(Aribtrary)
     bytes = max_iface * 32
     is_32bit = (8 * struct.calcsize("P")) == 32  # Set Architecture
-    struct_size = 32 if is_32bit else 40
+    struct_size = None
+    if is_32bit:
+      struct_size = 32
+    else:
+      struct_size = 40
 
     try:
         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
diff -up mozilla-esr31/testing/mozbase/moznetwork/tests/test.py.python3 mozilla-esr31/testing/mozbase/moznetwork/tests/test.py
--- mozilla-esr31/testing/mozbase/moznetwork/tests/test.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/moznetwork/tests/test.py	2014-09-05 15:26:14.107681183 +0200
@@ -64,7 +64,8 @@ class TestGetIP(unittest.TestCase):
 
         if mozinfo.isLinux or mozinfo.isMac:
 
-            with mock.patch('socket.gethostbyname') as byname:
+            byname = mock.patch('socket.gethostbyname').__enter__()
+            if 1:
                 # Force socket.gethostbyname to return None
                 byname.return_value = None
 
@@ -74,5 +75,6 @@ class TestGetIP(unittest.TestCase):
                 self.assertTrue(verify_ip_in_list(ip))
 
 
+            byname.__exit__(0, 0, 0)
 if __name__ == '__main__':
     unittest.main()
diff -up mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess_params.py.python3 mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess_params.py
--- mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess_params.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess_params.py	2014-09-05 15:26:14.107681183 +0200
@@ -17,7 +17,7 @@ class ParamTests(unittest.TestCase):
         err = None
         try:
             p = processhandler.ProcessHandler(['ls','-l'], processOutputLine=output)
-        except (TypeError, AttributeError) as e:
+        except (TypeError, AttributeError), e:
             err = e
         self.assertFalse(err)
 
@@ -28,7 +28,7 @@ class ParamTests(unittest.TestCase):
         err = None
         try:
             p = processhandler.ProcessHandler(['ls','-l'], processOutputLine=[output])
-        except (TypeError, AttributeError) as e:
+        except (TypeError, AttributeError), e:
             err = e
         self.assertFalse(err)
 
@@ -40,7 +40,7 @@ class ParamTests(unittest.TestCase):
         err = None
         try:
             p = processhandler.ProcessHandler(['sleep', '2'], onTimeout=timeout)
-        except (TypeError, AttributeError) as e:
+        except (TypeError, AttributeError), e:
             err = e
         self.assertFalse(err)
 
@@ -51,7 +51,7 @@ class ParamTests(unittest.TestCase):
         err = None
         try:
             p = processhandler.ProcessHandler(['sleep', '2'], onTimeout=[timeout])
-        except (TypeError, AttributeError) as e:
+        except (TypeError, AttributeError), e:
             err = e
         self.assertFalse(err)
 
@@ -62,7 +62,7 @@ class ParamTests(unittest.TestCase):
         err = None
         try:
             p = processhandler.ProcessHandler(['sleep', '1'], onFinish=finish)
-        except (TypeError, AttributeError) as e:
+        except (TypeError, AttributeError), e:
             err = e
         self.assertFalse(err)
 
@@ -73,7 +73,7 @@ class ParamTests(unittest.TestCase):
         err = None
         try:
             p = processhandler.ProcessHandler(['sleep', '1'], onFinish=[finish])
-        except (TypeError, AttributeError) as e:
+        except (TypeError, AttributeError), e:
             err = e
         self.assertFalse(err)
 
diff -up mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess.py.python3 mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess.py
--- mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprocess/tests/test_mozprocess.py	2014-09-05 15:26:14.107681183 +0200
@@ -117,7 +117,7 @@ class ProcTest(unittest.TestCase):
             if os.path.exists(path):
                 try:
                     os.remove(path)
-                except OSError as e:
+                except OSError, e:
                     errors.append(str(e))
         if errors:
             raise OSError("Error(s) encountered tearing down %s.%s:\n%s" % (cls.__module__, cls.__name__, '\n'.join(errors)))
diff -up mozilla-esr31/testing/mozbase/mozprofile/mozprofile/addons.py.python3 mozilla-esr31/testing/mozbase/mozprofile/mozprofile/addons.py
--- mozilla-esr31/testing/mozbase/mozprofile/mozprofile/addons.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprofile/mozprofile/addons.py	2014-09-05 15:26:14.107681183 +0200
@@ -275,8 +275,10 @@ class AddonManager(object):
                 finally:
                     compressed_file.close()
             elif os.path.isdir(addon_path):
-                with open(os.path.join(addon_path, 'install.rdf'), 'r') as f:
+                f = open(os.path.join(addon_path, 'install.rdf'), 'r')
+                if 1:
                     manifest = f.read()
+                f.close()
             else:
                 raise IOError('Add-on path is neither an XPI nor a directory: %s' % addon_path)
         except (IOError, KeyError), e:
@@ -334,8 +336,7 @@ class AddonManager(object):
             if not os.path.isdir(path):
                 return
 
-            addons = [os.path.join(path, x) for x in os.listdir(path) if
-                      self.is_addon(os.path.join(path, x))]
+            addons = [os.path.join(path, x) for x in os.listdir(path) if self.is_addon(os.path.join(path, x))]
             addons.sort()
 
         # install each addon
diff -up mozilla-esr31/testing/mozbase/mozprofile/mozprofile/profile.py.python3 mozilla-esr31/testing/mozbase/mozprofile/mozprofile/profile.py
--- mozilla-esr31/testing/mozbase/mozprofile/mozprofile/profile.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprofile/mozprofile/profile.py	2014-09-05 15:26:14.107681183 +0200
@@ -206,8 +206,10 @@ class Profile(object):
         """
 
         path = os.path.join(self.profile, filename)
-        with file(path) as f:
+        f = file(path).__enter__()
+        if 1:
             lines = f.read().splitlines()
+        f.__exit__(0, 0, 0)
         def last_index(_list, value):
             """
             returns the last index of an item;
@@ -231,8 +233,10 @@ class Profile(object):
 
         # write the prefs
         cleaned_prefs = '\n'.join(lines[:s] + lines[e+1:])
-        with file(path, 'w') as f:
+        f = file(path, 'w').__enter__()
+        if 1:
             f.write(cleaned_prefs)
+        f.__exit__(0, 0, 0)
         return True
 
     ### methods for introspection
diff -up mozilla-esr31/testing/mozbase/mozprofile/tests/addon_stubs.py.python3 mozilla-esr31/testing/mozbase/mozprofile/tests/addon_stubs.py
--- mozilla-esr31/testing/mozbase/mozprofile/tests/addon_stubs.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprofile/tests/addon_stubs.py	2014-09-05 15:26:14.107681183 +0200
@@ -49,18 +49,22 @@ def generate_addon(addon_id, path=None,
     # Write install.rdf for addon
     if stubs[addon_id]:
         install_rdf = os.path.join(addon_dir, 'install.rdf')
-        with open(install_rdf, 'w') as f:
+        f = open(install_rdf, 'w')
+        if 1:
             manifest = os.path.join(here, 'install_manifests', stubs[addon_id])
             f.write(open(manifest, 'r').read())
 
+        f.close()
     if not xpi:
         return addon_dir
 
     # Generate the .xpi for the addon
     xpi_file = os.path.join(tmpdir, (name or addon_id) + '.xpi')
-    with zipfile.ZipFile(xpi_file, 'w') as x:
+    x = zipfile.ZipFile(xpi_file, 'w').__enter__()
+    if 1:
         x.write(install_rdf, install_rdf[len(addon_dir):])
 
+    x.__exit__(0, 0, 0)
     # Ensure we remove the temporary folder to not install the addon twice
     mozfile.rmtree(addon_dir)
 
@@ -72,8 +76,10 @@ def generate_manifest(addon_list, path=N
     addons = [generate_addon(addon, path=tmpdir) for addon in addon_list]
 
     manifest = os.path.join(tmpdir, 'manifest.ini')
-    with open(manifest, 'w') as f:
+    f = open(manifest, 'w')
+    if 1:
         for addon in addons:
             f.write('[' + addon + ']\n')
 
+    f.close()
     return manifest
diff -up mozilla-esr31/testing/mozbase/mozprofile/tests/permissions.py.python3 mozilla-esr31/testing/mozbase/mozprofile/tests/permissions.py
--- mozilla-esr31/testing/mozbase/mozprofile/tests/permissions.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprofile/tests/permissions.py	2014-09-05 15:26:14.108681187 +0200
@@ -149,7 +149,11 @@ http://127.0.0.1:8888           privileg
 
         self.assertEqual(len(entries), 3)
 
-        columns = 8 if version == 3 else 6
+        columns = None
+        if version == 3:
+          columns = 8
+        else:
+          columns = 6
         self.assertEqual(len(entries[0]), columns)
         for x in range(4, columns):
             self.assertEqual(entries[0][x], 0)
diff -up mozilla-esr31/testing/mozbase/mozprofile/tests/test_addons.py.python3 mozilla-esr31/testing/mozbase/mozprofile/tests/test_addons.py
--- mozilla-esr31/testing/mozbase/mozprofile/tests/test_addons.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprofile/tests/test_addons.py	2014-09-05 15:26:14.108681187 +0200
@@ -64,8 +64,7 @@ class TestAddonsManager(unittest.TestCas
         self.assertEqual(self.am.installed_addons, [addon_xpi])
         self.am.clean()
 
-        # Even if it is the same id the add-on should be installed twice, if
-        # specified via XPI and folder
+        # Even if it is the same id the add-on should be installed twice, if # specified via XPI and folder
         self.am.install_addons([addon_folder, addon_xpi])
         self.assertEqual(len(self.am.installed_addons), 2)
         self.assertIn(addon_folder, self.am.installed_addons)
diff -up mozilla-esr31/testing/mozbase/mozprofile/tests/test_preferences.py.python3 mozilla-esr31/testing/mozbase/mozprofile/tests/test_preferences.py
--- mozilla-esr31/testing/mozbase/mozprofile/tests/test_preferences.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozprofile/tests/test_preferences.py	2014-09-05 15:26:14.108681187 +0200
@@ -241,10 +241,12 @@ user_pref("webgl.force-enabled", true);
         path = None
         read_prefs = None
         try:
-            with mozfile.NamedTemporaryFile(suffix='.js', delete=False) as f:
+            f = mozfile.NamedTemporaryFile(suffix='.js', delete=False).__enter__()
+            if 1:
                 path = f.name
                 preferences.write(f, _prefs)
 
+            f.__exit__(0, 0, 0)
             # read them back and ensure we get what we put in
             read_prefs = dict(Preferences.read_prefs(path))
 
diff -up mozilla-esr31/testing/mozbase/mozrunner/mozrunner/base.py.python3 mozilla-esr31/testing/mozbase/mozrunner/mozrunner/base.py
--- mozilla-esr31/testing/mozbase/mozrunner/mozrunner/base.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozrunner/mozrunner/base.py	2014-09-05 15:26:14.108681187 +0200
@@ -11,7 +11,7 @@ from mozprocess.processhandler import Pr
 import mozcrash
 import mozlog
 
-from .errors import RunnerNotStartedError
+from errors import RunnerNotStartedError
 
 
 # we can replace these methods with 'abc'
@@ -99,8 +99,7 @@ class Runner(object):
 
         :param timeout: if not None, will return after timeout seconds.
                         Use is_running() to determine whether or not a
-                        timeout occured. Timeout is ignored if
-                        interactive was set to True.
+                        timeout occured. Timeout is ignored if interactive was set to True.
 
         """
         if self.is_running():
diff -up mozilla-esr31/testing/mozbase/mozrunner/mozrunner/__init__.py.python3 mozilla-esr31/testing/mozbase/mozrunner/mozrunner/__init__.py
--- mozilla-esr31/testing/mozbase/mozrunner/mozrunner/__init__.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozrunner/mozrunner/__init__.py	2014-09-05 15:26:14.108681187 +0200
@@ -2,10 +2,10 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from .errors import *
-from .local import *
-from .local import LocalRunner as Runner
-from .remote import *
+from errors import *
+from local import *
+from local import LocalRunner as Runner
+from remote import *
 
 runners = local_runners
 runners.update(remote_runners)
diff -up mozilla-esr31/testing/mozbase/mozrunner/mozrunner/local.py.python3 mozilla-esr31/testing/mozbase/mozrunner/mozrunner/local.py
--- mozilla-esr31/testing/mozbase/mozrunner/mozrunner/local.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozrunner/mozrunner/local.py	2014-09-05 15:26:14.108681187 +0200
@@ -17,8 +17,8 @@ if mozinfo.isMac:
 
 from mozprofile import Profile, FirefoxProfile, MetroFirefoxProfile, ThunderbirdProfile, MozProfileCLI
 
-from .base import Runner
-from .utils import findInPath, get_metadata_from_egg
+from base import Runner
+from utils import findInPath, get_metadata_from_egg
 
 
 __all__ = ['CLI',
diff -up mozilla-esr31/testing/mozbase/mozrunner/mozrunner/remote.py.python3 mozilla-esr31/testing/mozbase/mozrunner/mozrunner/remote.py
--- mozilla-esr31/testing/mozbase/mozrunner/mozrunner/remote.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozrunner/mozrunner/remote.py	2014-09-05 15:26:14.108681187 +0200
@@ -17,7 +17,7 @@ from mozdevice import DMError
 import mozfile
 import mozlog
 
-from .base import Runner
+from base import Runner
 
 
 __all__ = ['B2GRunner',
diff -up mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py.python3 mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
--- mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py	2014-09-05 15:26:14.108681187 +0200
@@ -12,12 +12,12 @@ try:
 except Exception:
     psutil = None
 
-from collections import (
+from mycollections import (
     OrderedDict,
     namedtuple,
 )
 
-from contextlib import contextmanager
+
 
 
 def _collect(pipe, poll_interval):
@@ -126,9 +126,11 @@ class SystemResourceMonitor(object):
     monitor.record_event('foo_did_stuff')
 
     # Record that we're about to perform a possibly long-running event.
-    with monitor.phase('long_job'):
+    monitor.phase('long_job').__enter__()
+    if 1:
         foo.do_long_running_job()
 
+    monitor.phase('long_job').__exit__(0, 0, 0)
     # Stop recording. Currently we need to stop before data is available.
     monitor.stop()
 
diff -up mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/test/test_resource_monitor.py.python3 mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/test/test_resource_monitor.py
--- mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/test/test_resource_monitor.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozsystemmonitor/mozsystemmonitor/test/test_resource_monitor.py	2014-09-05 15:26:14.109681192 +0200
@@ -47,12 +47,14 @@ class TestResourceMonitor(unittest.TestC
         monitor.start()
         time.sleep(1)
 
-        with monitor.phase('phase1'):
+        monitor.phase('phase1').__enter__()
+        if 1:
             time.sleep(1)
 
             with monitor.phase('phase2'):
                 time.sleep(1)
 
+        monitor.phase('phase1').__exit__(0, 0, 0)
         monitor.stop()
 
         self.assertEqual(len(monitor.phases), 2)
diff -up mozilla-esr31/testing/mozbase/moztest/moztest/output/base.py.python3 mozilla-esr31/testing/mozbase/moztest/moztest/output/base.py
--- mozilla-esr31/testing/mozbase/moztest/moztest/output/base.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/moztest/moztest/output/base.py	2014-09-05 15:26:14.109681192 +0200
@@ -3,7 +3,7 @@
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
-from __future__ import with_statement
+
 from contextlib import closing
 from StringIO import StringIO
 
@@ -30,11 +30,13 @@ class Output(object):
 
     def dump_string(self, results_collection):
         """ Returns the string representation of the results collection """
-        with closing(StringIO()) as s:
+        s = closing(StringIO()).__enter__()
+        if 1:
             self.serialize(results_collection, s)
             return s.getvalue()
 
 
+        s.__exit__(0, 0, 0)
 # helper functions
 def count(iterable):
     """ Return the count of an iterable. Useful for generators. """
diff -up mozilla-esr31/testing/mozbase/moztest/moztest/results.py.python3 mozilla-esr31/testing/mozbase/moztest/moztest/results.py
--- mozilla-esr31/testing/mozbase/moztest/moztest/results.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/moztest/moztest/results.py	2014-09-05 15:26:14.109681192 +0200
@@ -90,7 +90,11 @@ class TestResult(object):
         self.name = name
         self.test_class = test_class
         self.context = context
-        self.time_start = time_start if time_start is not None else time.time()
+        self.time_start = None
+        if time_start is not None:
+          self.time_start = time_start
+        else:
+          self.time_start = time.time()
         self.time_end = None
         self._result_expected = result_expected
         self._result_actual = None
@@ -173,7 +177,11 @@ class TestResult(object):
         if isinstance(output, basestring):
             output = output.splitlines()
 
-        self.time_end = time_end if time_end is not None else time.time()
+        self.time_end = None
+        if time_end is not None:
+          self.time_end = time_end
+        else:
+          self.time_end = time.time()
         self.output = output or self.output
         self.reason = reason
 
diff -up mozilla-esr31/testing/mozbase/mozversion/mozversion/mozversion.py.python3 mozilla-esr31/testing/mozbase/mozversion/mozversion/mozversion.py
--- mozilla-esr31/testing/mozbase/mozversion/mozversion/mozversion.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozversion/mozversion/mozversion.py	2014-09-05 15:26:14.109681192 +0200
@@ -104,8 +104,10 @@ class B2GVersion(Version):
             gaia_commit = os.path.join(tempdir, 'gaia_commit.txt')
             try:
                 zip_file = zipfile.ZipFile(app_zip.name)
-                with open(gaia_commit, 'w') as f:
+                f = open(gaia_commit, 'w')
+                if 1:
                     f.write(zip_file.read('resources/gaia_commit.txt'))
+                f.__exit__(0, 0, 0)
             except zipfile.BadZipfile:
                 self.info('Unable to unzip application.zip, falling back to '
                           'system unzip')
@@ -113,11 +115,13 @@ class B2GVersion(Version):
                 call(['unzip', '-j', app_zip.name, 'resources/gaia_commit.txt',
                       '-d', tempdir])
 
-            with open(gaia_commit) as f:
+            f = open(gaia_commit)
+            if 1:
                 changeset, date = f.read().splitlines()
                 self._info['gaia_changeset'] = re.match(
                     '^\w{40}$', changeset) and changeset or None
                 self._info['gaia_date'] = date
+            f.__exit__(0, 0, 0)
         finally:
             mozfile.remove(tempdir)
 
@@ -141,8 +145,10 @@ class LocalB2GVersion(B2GVersion):
             path, 'gaia', 'profile', 'webapps',
             'settings.gaiamobile.org', 'application.zip')
         if os.path.exists(zip_path):
-            with open(zip_path, 'rb') as zip_file:
+            zip_file = open(zip_path, 'rb').__enter__()
+            if 1:
                 self.get_gaia_info(zip_file)
+            zip_file.__exit__(0, 0, 0)
         else:
             self.warn('Error pulling gaia file')
 
@@ -170,18 +176,22 @@ class RemoteB2GVersion(B2GVersion):
 
         tempdir = tempfile.mkdtemp()
         for ini in ('application', 'platform'):
-            with open(os.path.join(tempdir, '%s.ini' % ini), 'w') as f:
+            f = open(os.path.join(tempdir, '%s.ini' % ini), 'w').__enter__()
+            if 1:
                 f.write(dm.pullFile('/system/b2g/%s.ini' % ini))
                 f.flush()
+            f.close()
         self.get_gecko_info(tempdir)
         mozfile.remove(tempdir)
 
         for path in ['/system/b2g', '/data/local']:
             path += '/webapps/settings.gaiamobile.org/application.zip'
             if dm.fileExists(path):
-                with tempfile.NamedTemporaryFile() as f:
+                f = tempfile.NamedTemporaryFile().__enter__()
+                if 1:
                     dm.getFile(path, f.name)
                     self.get_gaia_info(f)
+                f.close()
                 break
         else:
             self.warn('Error pulling gaia file')
diff -up mozilla-esr31/testing/mozbase/mozversion/tests/test_b2g.py.python3 mozilla-esr31/testing/mozbase/mozversion/tests/test_b2g.py
--- mozilla-esr31/testing/mozbase/mozversion/tests/test_b2g.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozversion/tests/test_b2g.py	2014-09-05 15:26:14.109681192 +0200
@@ -20,12 +20,16 @@ class SourcesTest(unittest.TestCase):
         self.tempdir = tempfile.mkdtemp()
 
         self.binary = os.path.join(self.tempdir, 'binary')
-        with open(self.binary, 'w') as f:
+        f = open(self.binary, 'w')
+        if 1:
             f.write('foobar')
 
-        with open(os.path.join(self.tempdir, 'application.ini'), 'w') as f:
+        f.__exit__(0, 0, 0)
+        f = open(os.path.join(self.tempdir, 'application.ini'), 'w').__enter__()
+        if 1:
             f.writelines("""[App]\nName = B2G\n""")
 
+        f.close()
     def tearDown(self):
         mozfile.remove(self.tempdir)
 
diff -up mozilla-esr31/testing/mozbase/mozversion/tests/test_binary.py.python3 mozilla-esr31/testing/mozbase/mozversion/tests/test_binary.py
--- mozilla-esr31/testing/mozbase/mozversion/tests/test_binary.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozversion/tests/test_binary.py	2014-09-05 15:26:14.109681192 +0200
@@ -34,28 +34,38 @@ SourceRepository = PlatformSourceRepo
         self.tempdir = tempfile.mkdtemp()
 
         self.binary = os.path.join(self.tempdir, 'binary')
-        with open(self.binary, 'w') as f:
+        f = open(self.binary, 'w')
+        if 1:
             f.write('foobar')
 
+        f.__exit__(0, 0, 0)
     def tearDown(self):
         os.chdir(self.cwd)
         mozfile.remove(self.tempdir)
 
     def test_binary(self):
-        with open(os.path.join(self.tempdir, 'application.ini'), 'w') as f:
+        f = open(os.path.join(self.tempdir, 'application.ini'), 'w')
+        if 1:
             f.writelines(self.application_ini)
 
-        with open(os.path.join(self.tempdir, 'platform.ini'), 'w') as f:
+        f.__exit__(0, 0, 0)
+        f = open(os.path.join(self.tempdir, 'platform.ini'), 'w').__enter__()
+        if 1:
             f.writelines(self.platform_ini)
 
+        f.__exit__(0, 0, 0)
         self._check_version(get_version(self.binary))
 
     def test_binary_in_current_path(self):
-        with open(os.path.join(self.tempdir, 'application.ini'), 'w') as f:
+        f = open(os.path.join(self.tempdir, 'application.ini'), 'w').__enter__()
+        if 1:
             f.writelines(self.application_ini)
 
-        with open(os.path.join(self.tempdir, 'platform.ini'), 'w') as f:
+        f.close()
+        f = open(os.path.join(self.tempdir, 'platform.ini'), 'w').__enter__()
+        if 1:
             f.writelines(self.platform_ini)
+        f.close()
         os.chdir(self.tempdir)
         self._check_version(get_version())
 
diff -up mozilla-esr31/testing/mozbase/mozversion/tests/test_sources.py.python3 mozilla-esr31/testing/mozbase/mozversion/tests/test_sources.py
--- mozilla-esr31/testing/mozbase/mozversion/tests/test_sources.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/mozversion/tests/test_sources.py	2014-09-05 15:26:14.109681192 +0200
@@ -28,31 +28,41 @@ class SourcesTest(unittest.TestCase):
         self.tempdir = tempfile.mkdtemp()
 
         self.binary = os.path.join(self.tempdir, 'binary')
-        with open(self.binary, 'w') as f:
+        f = open(self.binary, 'w')
+        if 1:
             f.write('foobar')
 
+        f.__exit__(0, 0, 0)
     def tearDown(self):
         os.chdir(self.cwd)
         mozfile.remove(self.tempdir)
 
     def test_sources(self):
-        with open(os.path.join(self.tempdir, 'application.ini'), 'w') as f:
+        f = open(os.path.join(self.tempdir, 'application.ini'), 'w')
+        if 1:
             f.writelines(self.application_ini)
 
+        f.__exit__(0, 0, 0)
         sources = os.path.join(self.tempdir, 'sources.xml')
-        with open(sources, 'w') as f:
+        f = open(sources, 'w').__enter__()
+        if 1:
             f.writelines(self.sources_xml)
 
+        f.__exit__(0, 0, 0)
         os.chdir(self.tempdir)
         self._check_version(get_version(sources=sources))
 
     def test_sources_in_current_directory(self):
-        with open(os.path.join(self.tempdir, 'application.ini'), 'w') as f:
+        f = open(os.path.join(self.tempdir, 'application.ini'), 'w').__enter__()
+        if 1:
             f.writelines(self.application_ini)
 
-        with open(os.path.join(self.tempdir, 'sources.xml'), 'w') as f:
+        f.close()
+        f = open(os.path.join(self.tempdir, 'sources.xml'), 'w').__enter__()
+        if 1:
             f.writelines(self.sources_xml)
 
+        f.close()
         os.chdir(self.tempdir)
         self._check_version(get_version())
 
diff -up mozilla-esr31/testing/mozbase/test.py.python3 mozilla-esr31/testing/mozbase/test.py
--- mozilla-esr31/testing/mozbase/test.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/mozbase/test.py	2014-09-05 15:26:14.109681192 +0200
@@ -90,7 +90,7 @@ def main(args=sys.argv[1:]):
     results = TestResultCollection.from_unittest_results(None, unittest_results)
 
     # exit according to results
-    sys.exit(1 if results.num_failures else 0)
+    sys.exit(0, 1)[results.num_failures]
 
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/testing/remotecppunittests.py.python3 mozilla-esr31/testing/remotecppunittests.py
--- mozilla-esr31/testing/remotecppunittests.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/remotecppunittests.py	2014-09-05 15:26:14.110681197 +0200
@@ -53,7 +53,8 @@ class RemoteCPPUnitTests(cppunittests.CP
 
     def push_libs(self):
         if self.options.local_apk:
-            with mozfile.TemporaryDirectory() as tmpdir:
+            tmpdir = mozfile.TemporaryDirectory().__enter__()
+            if 1:
                 apk_contents = ZipFile(self.options.local_apk)
                 szip = os.path.join(self.options.local_bin, '..', 'host', 'bin', 'szip')
                 if not os.path.exists(szip):
@@ -73,6 +74,7 @@ class RemoteCPPUnitTests(cppunittests.CP
                         if szip:
                             out = subprocess.check_output([szip, '-d', file], stderr=subprocess.STDOUT)
                         self.device.pushFile(os.path.join(tmpdir, info.filename), remote_file)
+            tmpdir.__exit__(0, 0, 0)
             return
 
         for file in os.listdir(self.options.local_lib):
@@ -132,12 +134,14 @@ class RemoteCPPUnitTests(cppunittests.CP
         returncode = self.device.shell([remote_bin], buf, env=env, cwd=self.remote_home_dir,
                                        timeout=cppunittests.CPPUnitTests.TEST_PROC_TIMEOUT)
         print >> sys.stdout, buf.getvalue()
-        with mozfile.TemporaryDirectory() as tempdir:
+        tempdir = mozfile.TemporaryDirectory().__enter__()
+        if 1:
             self.device.getDirectory(self.remote_home_dir, tempdir)
             if mozcrash.check_for_crashes(tempdir, symbols_path,
                                           test_name=basename):
                 log.testFail("%s | test crashed", basename)
                 return False
+        tempdir.__exit__(0, 0, 0)
         result = returncode == 0
         if not result:
             log.testFail("%s | test failed with return code %s",
@@ -182,7 +186,7 @@ class RemoteCPPUnittestOptions(cppunitte
         self.add_option("--localBinDir", action="store",
                         type = "string", dest = "local_bin",
                         help = "local path to bin directory")
-        defaults["local_bin"] = build_obj.bindir if build_obj is not None else None
+        defaults["local_bin"] = (None, build_obj.bindir)[build_objis not None]
 
         self.add_option("--remoteTestRoot", action = "store",
                     type = "string", dest = "remote_test_root",
@@ -234,7 +238,7 @@ def main():
     except Exception, e:
         log.error(str(e))
         result = False
-    sys.exit(0 if result else 1)
+    sys.exit((1, 0)[result])
 
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/testing/runcppunittests.py.python3 mozilla-esr31/testing/runcppunittests.py
--- mozilla-esr31/testing/runcppunittests.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/runcppunittests.py	2014-09-05 15:26:14.110681197 +0200
@@ -4,11 +4,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 import sys, os, tempfile, shutil
 from optparse import OptionParser
 import mozprocess, mozinfo, mozlog, mozcrash, mozfile
-from contextlib import contextmanager
+
 
 log = mozlog.getLogger('cppunittests')
 
@@ -32,7 +32,8 @@ class CPPUnitTests(object):
         """
         basename = os.path.basename(prog)
         log.info("Running test %s", basename)
-        with mozfile.TemporaryDirectory() as tempdir:
+        tempdir = mozfile.TemporaryDirectory().__enter__()
+        if 1:
             proc = mozprocess.ProcessHandler([prog],
                                              cwd=tempdir,
                                              env=env)
@@ -55,6 +56,7 @@ class CPPUnitTests(object):
                              basename, proc.proc.returncode)
             return result
 
+        tempdir.__exit__(0, 0, 0)
     def build_core_environment(self, env = {}):
         """
         Add environment variables likely to be used across all platforms, including remote systems.
@@ -151,13 +153,15 @@ def extract_unittests_from_args(args, ma
 
     if manifest_file:
         skipped_progs.add(os.path.basename(manifest_file))
-        with open(manifest_file) as f:
+        f = open(manifest_file)
+        if 1:
             for line in f:
                 # strip out comment, if any
                 prog = line.split('#')[0]
                 if prog:
                     skipped_progs.add(prog.strip())
 
+        f.close()
     for p in args:
         if os.path.isdir(p):
             progs.extend([os.path.abspath(os.path.join(p, x)) for x in os.listdir(p) if not x in skipped_progs])
@@ -184,7 +188,7 @@ def main():
     except Exception, e:
         log.error(str(e))
         result = False
-    sys.exit(0 if result else 1)
+    sys.exit((1, 0)[result])
 
 if __name__ == '__main__':
     main()
diff -up mozilla-esr31/testing/talos/mach_commands.py.python3 mozilla-esr31/testing/talos/mach_commands.py
--- mozilla-esr31/testing/talos/mach_commands.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/talos/mach_commands.py	2014-09-05 15:26:14.110681197 +0200
@@ -4,7 +4,11 @@
 
 # Integrates Talos mozharness with mach
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import sys
@@ -64,7 +68,7 @@ class TalosRunner(MozbuildObject):
            it updates it to the latest version"""
         try:
             mercurial = which.which('hg')
-        except which.WhichError as e:
+        except which.WhichError, e:
             print("You don't have hg in your PATH: {0}".format(e))
             raise e
         clone_cmd = [mercurial, 'clone', '-r', self.mozharness_rev,
@@ -112,7 +116,7 @@ class TalosRunner(MozbuildObject):
         try:
             config_file = open(self.config_file_path, 'wb')
             config_file.write(json.dumps(self.config))
-        except IOError as e:
+        except IOError, e:
             err_str = "Error writing to Talos Mozharness config file {0}:{1}"
             print(err_str.format(self.config_file_path, str(e)))
             raise e
@@ -145,6 +149,6 @@ class MachCommands(MachCommandBase):
 
         try:
             return talos.run_test(suite, repo, rev)
-        except Exception as e:
+        except Exception, e:
             print(str(e))
             return 1
diff -up mozilla-esr31/testing/talos/talos_from_code.py.python3 mozilla-esr31/testing/talos/talos_from_code.py
--- mozilla-esr31/testing/talos/talos_from_code.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/talos/talos_from_code.py	2014-09-05 15:26:14.110681197 +0200
@@ -103,7 +103,11 @@ def download_file(url, path="", saveAs=N
         except Exception, e:
             print "ERROR: %s" % str(e)
             sys.exit(1)
-    filename = saveAs if saveAs else get_filename_from_url(url)
+    filename = None
+    if saveAs:
+      filename = saveAs
+    else:
+      filename = get_filename_from_url(url)
     local_file = open(os.path.join(path, filename), 'wb')
     local_file.write(f.read())
     local_file.close()
diff -up mozilla-esr31/testing/tps/tps/phase.py.python3 mozilla-esr31/testing/tps/tps/phase.py
--- mozilla-esr31/testing/tps/tps/phase.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/tps/tps/phase.py	2014-09-05 15:26:14.110681197 +0200
@@ -31,7 +31,10 @@ class TPSTestPhase(object):
 
     @property
     def status(self):
-        return self._status if self._status else 'unknown'
+        if self._status:
+          return self._status
+        else:
+          return 'unknown'
 
     def run(self):
         # launch Firefox
diff -up mozilla-esr31/testing/tps/tps/testrunner.py.python3 mozilla-esr31/testing/tps/tps/testrunner.py
--- mozilla-esr31/testing/tps/tps/testrunner.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/tps/tps/testrunner.py	2014-09-05 15:26:14.110681197 +0200
@@ -16,8 +16,8 @@ import mozinfo
 from mozprofile import Profile
 import mozversion
 
-from .firefoxrunner import TPSFirefoxRunner
-from .phase import TPSTestPhase
+from firefoxrunner import TPSFirefoxRunner
+from phase import TPSTestPhase
 
 
 class TempFile(object):
@@ -118,7 +118,11 @@ class TPSTestRunner(object):
                  resultfile='tps_result.json',
                  testfile=None):
         self.binary = binary
-        self.config = config if config else {}
+        self.config = None
+        if config:
+          self.config = config
+        else:
+          self.config = {}
         self.debug = debug
         self.extensions = []
         self.ignore_unused_engines = ignore_unused_engines
@@ -149,7 +153,7 @@ class TPSTestRunner(object):
     @mobile.setter
     def mobile(self, value):
         self._mobile = value
-        self.synctype = 'desktop' if not self._mobile else 'mobile'
+        self.synctype = ('mobile', 'desktop')[not self._mobile]
 
     def log(self, msg, printToConsole=False):
         """Appends a string to the logfile"""
@@ -258,7 +262,8 @@ class TPSTestRunner(object):
                         for f in files:
                             weavelog = os.path.join(profiles[profile].profile, 'weave', 'logs', f)
                             if os.access(weavelog, os.F_OK):
-                                with open(weavelog, 'r') as fh:
+                                fh = open(weavelog, 'r')
+                                if 1:
                                     for line in fh:
                                         possible_time = line[0:13]
                                         if len(possible_time) == 13 and possible_time.isdigit():
@@ -269,17 +274,30 @@ class TPSTestRunner(object):
                                                 formatted, time_ms % 1000, line[14:] ))
                                         else:
                                             self.log(line)
+                                fh.close()
                 break;
 
         # grep the log for FF and sync versions
         f = open(self.logfile)
         logdata = f.read()
         match = self.syncVerRe.search(logdata)
-        sync_version = match.group('syncversion') if match else 'unknown'
+        sync_version = None
+        if match:
+          sync_version = match.group('syncversion')
+        else:
+          sync_version = 'unknown'
         match = self.ffVerRe.search(logdata)
-        firefox_version = match.group('ffver') if match else 'unknown'
+        firefox_version = None
+        if match:
+          firefox_version = match.group('ffver')
+        else:
+          firefox_version = 'unknown'
         match = self.ffBuildIDRe.search(logdata)
-        firefox_buildid = match.group('ffbuildid') if match else 'unknown'
+        firefox_buildid = None
+        if match:
+          firefox_buildid = match.group('ffbuildid')
+        else:
+          firefox_buildid = 'unknown'
         f.close()
         if phase.status == 'PASS':
             logdata = ''
@@ -292,7 +310,11 @@ class TPSTestRunner(object):
           'FAIL': lambda x: ('TEST-UNEXPECTED-FAIL', x.rstrip()),
           'unknown': lambda x: ('TEST-UNEXPECTED-FAIL', 'test did not complete')
         } [phase.status](phase.errline)
-        logstr = "\n%s | %s%s\n" % (result[0], testname, (' | %s' % result[1] if result[1] else ''))
+        logstr = None
+        if result[1]:
+          logstr = "\n%s | %s%s\n" % (result[0], testname, (' | %s' % result[1]
+        else:
+          logstr = ''))
 
         try:
             repoinfo = mozversion.get_version(self.binary)
diff -up mozilla-esr31/testing/xpcshell/mach_commands.py.python3 mozilla-esr31/testing/xpcshell/mach_commands.py
--- mozilla-esr31/testing/xpcshell/mach_commands.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/xpcshell/mach_commands.py	2014-09-05 15:26:14.110681197 +0200
@@ -4,7 +4,7 @@
 
 # Integrates the xpcshell test runner with mach.
 
-from __future__ import unicode_literals, print_function
+, print_function
 
 import mozpack.path
 import logging
@@ -154,8 +154,7 @@ class XPCShellRunner(MozbuildObject):
             'debugger': debugger,
             'debuggerArgs': debuggerArgs,
             'debuggerInteractive': debuggerInteractive,
-            'on_message': (lambda obj, msg: xpcshell.log.info(msg.decode('utf-8', 'replace'))) \
-                            if verbose_output else None,
+            'on_message': (lambda obj, msg: (None, xpcshell.log.info(msg.decode('utf-8', 'replace'))))[verbose_output],
         }
 
         if test_path is not None:
@@ -320,8 +319,10 @@ class B2GXPCShellRunner(MozbuildObject):
                   'initial setup will be slow.')
             return
 
-        with open(busybox_path, 'wb') as f:
+        f = open(busybox_path, 'wb')
+        if 1:
             f.write(data.read())
+        f.close()
         return busybox_path
 
     def run_test(self, test_paths, b2g_home=None, busybox=None,
@@ -442,6 +443,6 @@ class MachCommands(MachCommandBase):
 
         try:
             return xpcshell.run_test(**params)
-        except InvalidTestPathError as e:
+        except InvalidTestPathError, e:
             print(e.message)
             return 1
diff -up mozilla-esr31/testing/xpcshell/remotexpcshelltests.py.python3 mozilla-esr31/testing/xpcshell/remotexpcshelltests.py
--- mozilla-esr31/testing/xpcshell/remotexpcshelltests.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/xpcshell/remotexpcshelltests.py	2014-09-05 15:26:14.111681202 +0200
@@ -130,10 +130,11 @@ class RemoteXPCShellTestThread(xpcshell.
         self.timedout = False
         cmd.insert(1, self.remoteHere)
         outputFile = "xpcshelloutput"
-        with open(outputFile, 'w+') as f:
+        f = open(outputFile, 'w+')
+        if 1:
             try:
                 self.shellReturnCode = self.device.shell(cmd, f)
-            except devicemanager.DMError as e:
+            except devicemanager.DMError, e:
                 if self.timedout:
                     # If the test timed out, there is a good chance the SUTagent also
                     # timed out and failed to return a return code, generating a
@@ -142,6 +143,7 @@ class RemoteXPCShellTestThread(xpcshell.
                     pass
                 else:
                     raise e
+        f.close()
         # The device manager may have timed out waiting for xpcshell.
         # Guard against an accumulation of hung processes by killing
         # them here. Note also that IPC tests may spawn new instances
@@ -161,11 +163,13 @@ class RemoteXPCShellTestThread(xpcshell.
             print "Automation Error: No crash directory (%s) found on remote device" % self.remoteMinidumpDir
             # Whilst no crash was found, the run should still display as a failure
             return True
-        with mozfile.TemporaryDirectory() as dumpDir:
+        dumpDir = mozfile.TemporaryDirectory().__enter__()
+        if 1:
             self.device.getDirectory(self.remoteMinidumpDir, dumpDir)
             crashed = xpcshell.XPCShellTestThread.checkForCrashes(self, dumpDir, symbols_path, test_name)
             self.device.removeDir(self.remoteMinidumpDir)
             self.device.mkDir(self.remoteMinidumpDir)
+        dumpDir.__exit__(0, 0, 0)
         return crashed
 
     def communicate(self, proc):
@@ -333,7 +337,7 @@ class XPCShellRemote(xpcshell.XPCShellTe
                 packageName = self.localAPKContents.read("package-name.txt")
                 if packageName:
                     self.appRoot = self.device.getAppRoot(packageName.strip())
-            except Exception as detail:
+            except Exception, detail:
                 print "unable to determine app root: " + str(detail)
                 pass
         return None
diff -up mozilla-esr31/testing/xpcshell/runxpcshelltests.py.python3 mozilla-esr31/testing/xpcshell/runxpcshelltests.py
--- mozilla-esr31/testing/xpcshell/runxpcshelltests.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/xpcshell/runxpcshelltests.py	2014-09-05 15:26:14.111681202 +0200
@@ -82,7 +82,7 @@ import mozinfo
 _cleanup_encoding_re = re.compile(u'[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f\\\\]')
 def _cleanup_encoding_repl(m):
     c = m.group(0)
-    return '\\\\' if c == '\\' else '\\x{0:02X}'.format(ord(c))
+    return ('\\x{0:02X}', '\\\\')[c == '\\'].format(ord(c))
 def cleanup_encoding(s):
     """S is either a byte or unicode string.  Either way it may
        contain control characters, unpaired surrogates, reserved code
@@ -164,7 +164,7 @@ class XPCShellTestThread(Thread):
     def run(self):
         try:
             self.run_test()
-        except Exception as e:
+        except Exception, e:
             self.exception = e
             self.traceback = traceback.format_exc()
         else:
@@ -202,9 +202,11 @@ class XPCShellTestThread(Thread):
           For a given test file and stdout buffer, create a log file.
           On a remote system we have to fix the test name since it can contain directories.
         """
-        with open(test_file + ".log", "w") as f:
+        f = open(test_file + ".log", "w")
+        if 1:
             f.write(stdout)
 
+        f.close()
     def getReturnCode(self, proc):
         """
           Simple wrapper to get the return code for a given process.
@@ -448,7 +450,11 @@ class XPCShellTestThread(Thread):
                     self.has_failure_output = True
             return line
 
-        msg = ['%s: ' % line['process'] if 'process' in line else '']
+        msg = None
+        if 'process' in line:
+          msg = ['%s: ' % line['process']
+        else:
+          msg = '']
 
         # Each call to the logger in head.js either specified '_message'
         # or both 'source_file' and 'diagnostic'. If either of these are
@@ -463,7 +469,7 @@ class XPCShellTestThread(Thread):
                                          line.get('source_file', 'undefined'),
                                          line.get('diagnostic', 'undefined')))
 
-        msg.append('\n%s' % line['stack'] if 'stack' in line else '')
+        msg.append('\n%s' % ('', line['stack']')['stack' in line ])
         return ''.join(msg)
 
     def parse_output(self, output):
@@ -646,16 +652,18 @@ class XPCShellTestThread(Thread):
                     self.clean_temp_dirs(name, stdout)
                     return
 
-                failureType = "TEST-UNEXPECTED-%s" % ("FAIL" if expected else "PASS")
+                failureType = "TEST-UNEXPECTED-%s" % (("PASS", "FAIL")[expected])
                 message = "%s | %s | test failed (with xpcshell return code: %d)" % (
                               failureType, name, self.getReturnCode(proc))
                 if self.output_lines:
                     message += ", see following log:"
 
-                with LOG_MUTEX:
+                LOG_MUTEX.__enter__()
+                if 1:
                     self.log.error(message)
                     self.log_output(self.output_lines)
 
+                LOG_MUTEX.__exit__(0, 0, 0)
                 self.failCount += 1
                 self.xunit_result["passed"] = False
 
@@ -666,21 +674,25 @@ class XPCShellTestThread(Thread):
                 }
 
                 if self.failureManifest:
-                    with open(self.failureManifest, 'a') as f:
+                    f = open(self.failureManifest, 'a')
+                    if 1:
                         f.write('[%s]\n' % self.test_object['path'])
                         for k, v in self.test_object.items():
                             f.write('%s = %s\n' % (k, v))
 
+                    f.close()
             else:
                 now = time.time()
                 timeTaken = (now - startTime) * 1000
                 self.xunit_result["time"] = now - startTime
 
-                with LOG_MUTEX:
-                    self.log.info("TEST-%s | %s | test passed (time: %.3fms)" % ("PASS" if expected else "KNOWN-FAIL", name, timeTaken))
+                LOG_MUTEX.__enter__()
+                if 1:
+                    self.log.info("TEST-%s | %s | test passed (time: %.3fms)" % (("KNOWN-FAIL", "PASS")[expected], name, timeTaken))
                     if self.verbose:
                         self.log_output(self.output_lines)
 
+                LOG_MUTEX.__exit__(0, 0, 0)
                 self.xunit_result["passed"] = True
                 self.retry = False
 
@@ -717,11 +729,13 @@ class XPCShellTestThread(Thread):
                     self.clean_temp_dirs(name, stdout)
                     return
 
-                with LOG_MUTEX:
+                LOG_MUTEX.__enter__()
+                if 1:
                     message = "TEST-UNEXPECTED-FAIL | %s | Process still running after test!" % name
                     self.log.error(message)
                     self.log_output(self.output_lines)
 
+                LOG_MUTEX.__exit__(0, 0, 0)
                 self.failCount = 1
                 self.xunit_result["passed"] = False
                 self.xunit_result["failure"] = {
@@ -768,8 +782,10 @@ class XPCShellTests(object):
             if unwrapped:
                 def wrap(fn):
                     def wrapped(*args, **kwargs):
-                        with LOG_MUTEX:
+                        LOG_MUTEX.__enter__()
+                        if 1:
                             fn(*args, **kwargs)
+                        LOG_MUTEX.__exit__(0, 0, 0)
                     return wrapped
                 setattr(self.log, fun_name, wrap(unwrapped))
 
diff -up mozilla-esr31/testing/xpcshell/selftest.py.python3 mozilla-esr31/testing/xpcshell/selftest.py
--- mozilla-esr31/testing/xpcshell/selftest.py.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/testing/xpcshell/selftest.py	2014-09-05 15:26:14.111681202 +0200
@@ -4,7 +4,7 @@
 # http://creativecommons.org/publicdomain/zero/1.0/
 #
 
-from __future__ import with_statement
+
 import sys, os, unittest, tempfile, shutil
 import mozinfo
 
@@ -243,8 +243,10 @@ class XPCShellTestsTests(unittest.TestCa
         and return the full path to the file.
         """
         fullpath = os.path.join(self.tempdir, name)
-        with open(fullpath, "w") as f:
+        f = open(fullpath, "w")
+        if 1:
             f.write(contents)
+        f.close()
         return fullpath
 
     def writeManifest(self, tests):
@@ -257,8 +259,7 @@ class XPCShellTestsTests(unittest.TestCa
         """
         testlines = []
         for t in tests:
-            testlines.append("[%s]" % (t if isinstance(t, basestring)
-                                       else t[0]))
+            (testlines.append("[%s]" % (t[0], t)[isinstance(t, basestring)]))
             if isinstance(t, tuple):
                 testlines.extend(t[1:])
         self.manifest = self.writeFile("xpcshell.ini", """
@@ -286,7 +287,7 @@ tail =
 ========
 %s
 ========
-""" % ("passed" if expected else "failed", self.log.getvalue()))
+""" % (("failed", "passed")[expected], self.log.getvalue()))
 
     def _assertLog(self, s, expected):
         l = self.log.getvalue()
@@ -294,7 +295,7 @@ tail =
                          msg="""Value %s %s in log:
 ========
 %s
-========""" % (s, "expected" if expected else "not expected", l))
+========""" % (s, ("not expected", "expected")[expected], l))
 
     def assertInLog(self, s):
         """
diff -up mozilla-esr31/toolkit/components/diskspacewatcher/moz.build.python3 mozilla-esr31/toolkit/components/diskspacewatcher/moz.build
--- mozilla-esr31/toolkit/components/diskspacewatcher/moz.build.python3	2014-08-25 15:17:27.000000000 +0200
+++ mozilla-esr31/toolkit/components/diskspacewatcher/moz.build	2014-09-05 15:26:14.111681202 +0200
@@ -14,9 +14,11 @@ EXPORTS += [
 
 XPIDL_MODULE = 'diskspacewatcher'
 
-SOURCES = [
+SOURCES += [
     'DiskSpaceWatcher.cpp',
 ]
+print("SOURCES CLASS")
+print(SOURCES.__class__)
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
diff -up mozilla-esr31/toolkit/components/telemetry/gen-histogram-data.py.python3 mozilla-esr31/toolkit/components/telemetry/gen-histogram-data.py
--- mozilla-esr31/toolkit/components/telemetry/gen-histogram-data.py.python3	2014-08-25 15:17:28.000000000 +0200
+++ mozilla-esr31/toolkit/components/telemetry/gen-histogram-data.py	2014-09-05 15:26:14.111681202 +0200
@@ -5,7 +5,7 @@
 # Write out histogram information for C++.  The histograms are defined
 # in a file provided as a command-line argument.
 
-from __future__ import with_statement
+
 
 import sys
 import histogram_tools
@@ -64,7 +64,7 @@ def print_array_entry(histogram, name_in
         % (histogram.low(), histogram.high(),
            histogram.n_buckets(), histogram.nsITelemetry_kind(),
            name_index, exp_index,
-           "true" if histogram.extended_statistics_ok() else "false")
+           ("false", "true")[histogram.extended_statistics_ok()])
     if cpp_guard:
         print "#endif"
 
diff -up mozilla-esr31/toolkit/components/telemetry/histogram_tools.py.python3 mozilla-esr31/toolkit/components/telemetry/histogram_tools.py
--- mozilla-esr31/toolkit/components/telemetry/histogram_tools.py.python3	2014-08-25 15:17:28.000000000 +0200
+++ mozilla-esr31/toolkit/components/telemetry/histogram_tools.py	2014-09-05 15:26:14.112681207 +0200
@@ -2,20 +2,20 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-import json
 import math
 import re
 
-from collections import OrderedDict
+import simplejson as json
+from simplejson import OrderedDict
 
 def table_dispatch(kind, table, body):
     """Call body with table[kind] if it exists.  Raise an error otherwise."""
     if kind in table:
         return body(table[kind])
     else:
-        raise BaseException, "don't know how to handle a histogram of kind %s" % kind
+        raise Exception, "don't know how to handle a histogram of kind %s" % kind
 
-class DefinitionException(BaseException):
+class DefinitionException(Exception):
     pass
 
 def check_numeric_limits(dmin, dmax, n_buckets):
@@ -225,7 +225,10 @@ def from_file(filename):
     """Return an iterator that provides a sequence of Histograms for
 the histograms defined in filename.
     """
-    with open(filename, 'r') as f:
+    f = open(filename, 'r')
+    if 1:
         histograms = json.load(f, object_pairs_hook=OrderedDict)
         for (name, definition) in histograms.iteritems():
             yield Histogram(name, definition)
+    f.close()
+
diff -up mozilla-esr31/toolkit/crashreporter/tools/symbolstore.py.python3 mozilla-esr31/toolkit/crashreporter/tools/symbolstore.py
--- mozilla-esr31/toolkit/crashreporter/tools/symbolstore.py.python3	2014-08-25 15:17:28.000000000 +0200
+++ mozilla-esr31/toolkit/crashreporter/tools/symbolstore.py	2014-09-05 15:26:14.112681207 +0200
@@ -388,15 +388,18 @@ class Dumper:
         """Increments the number of submitted jobs for the specified key file,
         defined as the original file we processed; note that a single key file
         can generate up to 1 + len(self.archs) jobs in the Mac case."""
-        with Dumper.jobs_condition:
+        Dumper.jobs_condition.__enter__()
+        if 1:
             self.jobs_record[file_key] += 1
             Dumper.jobs_condition.notify_all()
 
+        Dumper.jobs_condition.__exit__(0, 0, 0)
     def JobFinished(self, file_key):
         """Decrements the number of submitted jobs for the specified key file,
         defined as the original file we processed; once the count is back to 0,
         remove the entry from our record."""
-        with Dumper.jobs_condition:
+        Dumper.jobs_condition.__enter__()
+        if 1:
             self.jobs_record[file_key] -= 1
 
             if self.jobs_record[file_key] == 0:
@@ -404,13 +407,16 @@ class Dumper:
 
             Dumper.jobs_condition.notify_all()
 
+        Dumper.jobs_condition.__exit__(0, 0, 0)
     def output(self, dest, output_str):
         """Writes |output_str| to |dest|, holding |lock|;
         terminates with a newline."""
-        with Dumper.lock:
+        Dumper.lock.__enter__()
+        if 1:
             dest.write(output_str + "\n")
             dest.flush()
 
+        Dumper.lock.__exit__(0, 0, 0)
     def output_pid(self, dest, output_str):
         """Debugging output; prepends the pid to the string."""
         self.output(dest, "%d: %s" % (os.getpid(), output_str))
@@ -499,9 +505,11 @@ class Dumper:
         wait for the pool to finish processing them. By default, will close
         and clear the pool, but for testcases that need multiple runs, pass
         stop_pool = False."""
-        with Dumper.jobs_condition:
+        Dumper.jobs_condition.__enter__()
+        if 1:
             while len(self.jobs_record) != 0:
                 Dumper.jobs_condition.wait()
+        Dumper.jobs_condition.__exit__(0, 0, 0)
         if stop_pool:
             Dumper.pool.close()
             Dumper.pool.join()
@@ -716,7 +724,11 @@ class Dumper_Win32(Dumper):
         return result
 
 class Dumper_Linux(Dumper):
-    objcopy = os.environ['OBJCOPY'] if 'OBJCOPY' in os.environ else 'objcopy'
+    objcopy = None
+    if 'OBJCOPY' in os.environ:
+      objcopy = os.environ['OBJCOPY']
+    else:
+      objcopy = 'objcopy'
     def ShouldProcess(self, file):
         """This function will allow processing of files that are
         executable, or end with the .so extension, and additionally
diff -up mozilla-esr31/toolkit/crashreporter/tools/unit-symbolstore.py.python3 mozilla-esr31/toolkit/crashreporter/tools/unit-symbolstore.py
--- mozilla-esr31/toolkit/crashreporter/tools/unit-symbolstore.py.python3	2014-08-25 15:17:28.000000000 +0200
+++ mozilla-esr31/toolkit/crashreporter/tools/unit-symbolstore.py	2014-09-05 15:26:14.112681207 +0200
@@ -68,7 +68,7 @@ class TestExclude(HelperMixin, unittest.
         processed = []
         def mock_process_file(filenames):
             for filename in filenames:
-                processed.append((filename[len(self.test_dir):] if filename.startswith(self.test_dir) else filename).replace('\\', '/'))
+                processed.append(((filename, filename[len(self.test_dir):]).replace('\\')[filename.startswith(self.test_dir)], '/'))
             return True
         self.add_test_files(add_extension(["foo", "bar", "abc/xyz", "abc/fooxyz", "def/asdf", "def/xyzfoo"]))
         d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
@@ -89,7 +89,7 @@ class TestExclude(HelperMixin, unittest.
         processed = []
         def mock_process_file(filenames):
             for filename in filenames:
-                processed.append((filename[len(self.test_dir):] if filename.startswith(self.test_dir) else filename).replace('\\', '/'))
+                processed.append(((filename, filename[len(self.test_dir):]).replace('\\')[filename.startswith(self.test_dir)], '/'))
             return True
         self.add_test_files(add_extension(["foo", "bar", "abc/foo", "abc/bar", "def/foo", "def/bar"]))
         d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
@@ -165,7 +165,7 @@ class TestCopyDebugUniversal(HelperMixin
         """
         copied = []
         def mock_copy_debug(filename, debug_file, guid):
-            copied.append(filename[len(self.symbol_dir):] if filename.startswith(self.symbol_dir) else filename)
+            copied.append((filename, filename[len(self.symbol_dir):])[filename.startswith(self.symbol_dir)]) 
         self.add_test_files(add_extension(["foo"]))
         self.stdouts.append(mock_dump_syms("X" * 33, add_extension(["foo"])[0]))
         self.stdouts.append(mock_dump_syms("Y" * 33, add_extension(["foo"])[0]))
diff -up mozilla-esr31/toolkit/devtools/acorn/moz.build.python3 mozilla-esr31/toolkit/devtools/acorn/moz.build
--- mozilla-esr31/toolkit/devtools/acorn/moz.build.python3	2014-08-25 15:17:28.000000000 +0200
+++ mozilla-esr31/toolkit/devtools/acorn/moz.build	2014-09-05 15:26:14.112681207 +0200
@@ -1,15 +1,15 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
-
-JS_MODULES_PATH = 'modules/devtools/acorn'
-
-EXTRA_JS_MODULES += [
-    'acorn.js',
-    'acorn_loose.js',
-    'walk.js',
-]
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
+
+JS_MODULES_PATH = 'modules/devtools/acorn'
+
+EXTRA_JS_MODULES += [
+    'acorn.js',
+    'acorn_loose.js',
+    'walk.js',
+]
diff -up mozilla-esr31/toolkit/mozapps/extensions/internal/moz.build.python3 mozilla-esr31/toolkit/mozapps/extensions/internal/moz.build
--- mozilla-esr31/toolkit/mozapps/extensions/internal/moz.build.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/toolkit/mozapps/extensions/internal/moz.build	2014-09-05 15:26:14.112681207 +0200
@@ -1,31 +1,31 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JS_MODULES_PATH = 'modules/addons'
-
-EXTRA_JS_MODULES += [
-    'AddonLogging.jsm',
-    'AddonRepository.jsm',
-    'AddonRepository_SQLiteMigrator.jsm',
-    'AddonUpdateChecker.jsm',
-    'Content.js',
-    'LightweightThemeImageOptimizer.jsm',
-    'PluginProvider.jsm',
-    'SpellCheckDictionaryBootstrap.js',
-]
-
-EXTRA_PP_JS_MODULES += [
-    'XPIProvider.jsm',
-    'XPIProviderUtils.js',
-]
-
-# This is used in multiple places, so is defined here to avoid it getting
-# out of sync.
-DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16
-
-# Additional debugging info is exposed in debug builds
-if CONFIG['MOZ_EM_DEBUG']:
-    DEFINES['MOZ_EM_DEBUG'] = 1
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+JS_MODULES_PATH = 'modules/addons'
+
+EXTRA_JS_MODULES += [
+    'AddonLogging.jsm',
+    'AddonRepository.jsm',
+    'AddonRepository_SQLiteMigrator.jsm',
+    'AddonUpdateChecker.jsm',
+    'Content.js',
+    'LightweightThemeImageOptimizer.jsm',
+    'PluginProvider.jsm',
+    'SpellCheckDictionaryBootstrap.js',
+]
+
+EXTRA_PP_JS_MODULES += [
+    'XPIProvider.jsm',
+    'XPIProviderUtils.js',
+]
+
+# This is used in multiple places, so is defined here to avoid it getting
+# out of sync.
+DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16
+
+# Additional debugging info is exposed in debug builds
+if CONFIG['MOZ_EM_DEBUG']:
+    DEFINES['MOZ_EM_DEBUG'] = 1
diff -up mozilla-esr31/toolkit/mozapps/installer/dozip.py.python3 mozilla-esr31/toolkit/mozapps/installer/dozip.py
--- mozilla-esr31/toolkit/mozapps/installer/dozip.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/toolkit/mozapps/installer/dozip.py	2014-09-05 15:26:14.112681207 +0200
@@ -29,7 +29,8 @@ def main(args):
 
     jarrer = Jarrer(optimize=False)
 
-    with errors.accumulate():
+    errors.accumulate().__enter__()
+    if 1:
         finder = FileFinder(args.base_dir)
         for i in args.input:
             path = mozpath.relpath(i, args.base_dir)
@@ -38,5 +39,6 @@ def main(args):
         jarrer.copy(args.zip)
 
 
+    errors.accumulate().__exit__(0, 0, 0)
 if __name__ == '__main__':
     main(sys.argv[1:])
diff -up mozilla-esr31/toolkit/mozapps/installer/find-dupes.py.python3 mozilla-esr31/toolkit/mozapps/installer/find-dupes.py
--- mozilla-esr31/toolkit/mozapps/installer/find-dupes.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/toolkit/mozapps/installer/find-dupes.py	2014-09-05 15:26:14.112681207 +0200
@@ -3,9 +3,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import sys
-import hashlib
+import md5
 from mozpack.packager.unpack import UnpackFinder
-from collections import OrderedDict
+from ordereddict import OrderedDict
 
 '''
 Find files duplicated in a given packaged directory, independently of its
@@ -17,7 +17,7 @@ def find_dupes(source):
     md5s = OrderedDict()
     for p, f in UnpackFinder(source):
         content = f.open().read()
-        m = hashlib.md5(content).digest()
+        m = md5.md5(content).digest()
         if not m in md5s:
             md5s[m] = (len(content), [])
         md5s[m][1].append(p)
@@ -26,7 +26,7 @@ def find_dupes(source):
     for m, (size, paths) in md5s.iteritems():
         if len(paths) > 1:
             print 'Duplicates %d bytes%s:' % (size,
-                  ' (%d times)' % (len(paths) - 1) if len(paths) > 2 else '')
+                  ' (%d times)' % ((0, len(paths) - 1)[len(paths) > 2]))
             print ''.join('  %s\n' % p for p in paths)
             total += (len(paths) - 1) * size
             num_dupes += 1
diff -up mozilla-esr31/toolkit/mozapps/installer/informulate.py.python3 mozilla-esr31/toolkit/mozapps/installer/informulate.py
--- mozilla-esr31/toolkit/mozapps/installer/informulate.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/toolkit/mozapps/installer/informulate.py	2014-09-05 15:26:14.112681207 +0200
@@ -37,10 +37,12 @@ def main():
     all_key_value_pairs = dict([(x.lower(), buildconfig.substs[x]) for x in important_substitutions])
     all_key_value_pairs.update(parse_cmdline(sys.argv[2:]))
 
-    with open(sys.argv[1], "w+") as f:
+    f = open(sys.argv[1], "w+")
+    if 1:
         json.dump(all_key_value_pairs, f, indent=2, sort_keys=True)
         f.write('\n')
 
 
+    f.close()
 if __name__=="__main__":
     main()
diff -up mozilla-esr31/toolkit/mozapps/installer/packager.py.python3 mozilla-esr31/toolkit/mozapps/installer/packager.py
--- mozilla-esr31/toolkit/mozapps/installer/packager.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/toolkit/mozapps/installer/packager.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,6 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from rhrebase import all, any
 from mozpack.packager.formats import (
     FlatFormatter,
     JarFormatter,
@@ -316,7 +317,8 @@ def main():
     elif not buildconfig.substs['CROSS_COMPILE']:
         launcher.tooldir = buildconfig.substs['LIBXUL_DIST']
 
-    with errors.accumulate():
+    errors.accumulate()
+    if 1:
         finder_args = dict(
             minify=args.minify,
             minify_js=args.minify_js,
@@ -353,6 +355,7 @@ def main():
             preprocess(removals_in, removals, defines)
             copier.add(mozpack.path.join(binpath, 'removed-files'), removals)
 
+    #errors.accumulate().__exit__(0, 0, 0)
     # shlibsign libraries
     if launcher.can_launch():
         for lib in SIGN_LIBS:
diff -up mozilla-esr31/tools/docs/conf.py.python3 mozilla-esr31/tools/docs/conf.py
--- mozilla-esr31/tools/docs/conf.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/docs/conf.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 import re
diff -up mozilla-esr31/tools/docs/mach_commands.py.python3 mozilla-esr31/tools/docs/mach_commands.py
--- mozilla-esr31/tools/docs/mach_commands.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/docs/mach_commands.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 
diff -up mozilla-esr31/tools/docs/moztreedocs/__init__.py.python3 mozilla-esr31/tools/docs/moztreedocs/__init__.py
--- mozilla-esr31/tools/docs/moztreedocs/__init__.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/docs/moztreedocs/__init__.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import os
 
@@ -98,9 +98,11 @@ class SphinxManager(object):
         m.populate_registry(copier)
         copier.copy(stage_dir)
 
-        with open(self._index_path, 'rb') as fh:
+        fh = open(self._index_path, 'rb')
+        if 1:
             data = fh.read()
 
+        fh.__exit__(0, 0, 0)
         indexes = ['%s/index' % p for p in sorted(self._trees.keys())]
         indexes = '\n   '.join(indexes)
 
@@ -109,5 +111,8 @@ class SphinxManager(object):
         packages = '\n   '.join(sorted(packages))
         data = data.format(indexes=indexes, python_packages=packages)
 
-        with open(os.path.join(stage_dir, 'index.rst'), 'wb') as fh:
+        fh = open(os.path.join(stage_dir, 'index.rst'), 'wb').__enter__()
+        if 1:
             fh.write(data)
+        fh.close()
+
diff -up mozilla-esr31/tools/mach_commands.py.python3 mozilla-esr31/tools/mach_commands.py
--- mozilla-esr31/tools/mach_commands.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/mach_commands.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import sys
 import os
@@ -247,8 +247,10 @@ class PastebinProvider(object):
 
         if file:
             try:
-                with open(file, 'r') as f:
+                f = open(file, 'r')
+                if 1:
                     content = f.read()
+                f.close()
                 # TODO: Use mime-types instead of extensions; suprocess('file <f_name>')
                 # Guess File-type based on file extension
                 extension = file.split('.')[-1]
@@ -344,7 +346,7 @@ class FormatProvider(MachCommandBase):
             if not clang_format_diff:
                 return 1
 
-        except urllib2.HTTPError as e:
+        except urllib2.HTTPError, e:
             print("HTTP error {0}: {1}".format(e.code, e.reason))
             return 1
 
@@ -360,7 +362,7 @@ class FormatProvider(MachCommandBase):
                 diff_process = Popen(["filterdiff", "--include=*.h", "--include=*.cpp",
                                       "--exclude-from-file=.clang-format-ignore"],
                                      stdin=git_process.stdout, stdout=PIPE)
-            except OSError as e:
+            except OSError, e:
                 if e.errno == errno.ENOENT:
                     print("Can't find filterdiff. Please install patchutils.")
                 else:
@@ -387,9 +389,11 @@ class FormatProvider(MachCommandBase):
             print("Downloading {0} to {1}".format(u, target))
             data = urllib2.urlopen(url=u).read()
             temp = target + ".tmp"
-            with open(temp, "wb") as fh:
+            fh = open(temp, "wb")
+            if 1:
                 fh.write(data)
                 fh.close()
+            fh.close()
             os.chmod(temp, os.stat(temp).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
             os.rename(temp, target)
         return target
diff -up mozilla-esr31/tools/mercurial/hgsetup/config.py.python3 mozilla-esr31/tools/mercurial/hgsetup/config.py
--- mozilla-esr31/tools/mercurial/hgsetup/config.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/mercurial/hgsetup/config.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this,
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 from configobj import ConfigObj
 import re
diff -up mozilla-esr31/tools/mercurial/hgsetup/wizard.py.python3 mozilla-esr31/tools/mercurial/hgsetup/wizard.py
--- mozilla-esr31/tools/mercurial/hgsetup/wizard.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/mercurial/hgsetup/wizard.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this,
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import unicode_literals
+
 
 import difflib
 import errno
@@ -19,7 +19,7 @@ from mozversioncontrol.repoupdate import
     update_git_repo,
 )
 
-from .config import (
+from config import (
     HOST_FINGERPRINTS,
     MercurialConfig,
 )
@@ -102,13 +102,13 @@ class MercurialSetupWizard(object):
     def run(self, config_paths):
         try:
             os.makedirs(self.ext_dir)
-        except OSError as e:
+        except OSError, e:
             if e.errno != errno.EEXIST:
                 raise
 
         try:
             hg = which.which('hg')
-        except which.WhichError as e:
+        except which.WhichError, e:
             print(e)
             print('Try running |mach bootstrap| to ensure your environment is '
                 'up to date.')
@@ -116,7 +116,7 @@ class MercurialSetupWizard(object):
 
         try:
             c = MercurialConfig(config_paths)
-        except ConfigObjError as e:
+        except ConfigObjError, e:
             print('Error importing existing Mercurial config!\n'
                   '%s\n'
                   'If using quotes, they must wrap the entire string.' % e)
@@ -212,9 +212,11 @@ class MercurialSetupWizard(object):
 
         config_path = c.config_path
         if os.path.exists(config_path):
-            with open(config_path, 'rt') as fh:
+            fh = open(config_path, 'rt')
+            if 1:
                 old_lines = [line.rstrip() for line in fh.readlines()]
 
+            fh.close()
         diff = list(difflib.unified_diff(old_lines, new_lines,
             'hgrc.old', 'hgrc.new'))
 
@@ -228,8 +230,10 @@ class MercurialSetupWizard(object):
                 print('')
 
             if self._prompt_yn('Would you like me to update your hgrc file'):
-                with open(config_path, 'wt') as fh:
+                fh = open(config_path, 'wt')
+                if 1:
                     c.write(fh)
+                fh.close()
                 print('Wrote changes to %s.' % config_path)
             else:
                 print('hgrc changes not written to file. I would have '
diff -up mozilla-esr31/tools/mercurial/mach_commands.py.python3 mozilla-esr31/tools/mercurial/mach_commands.py
--- mozilla-esr31/tools/mercurial/mach_commands.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/mercurial/mach_commands.py	2014-09-05 15:26:14.113681212 +0200
@@ -2,7 +2,11 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this,
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import print_function, unicode_literals
+def print24(msg, file):
+  if file:
+    file.write(msg)
+  else:
+    print msg
 
 import os
 import sys
@@ -34,7 +38,9 @@ class VersionControlCommands(object):
         # Touch a file so we can periodically prompt to update extensions.
         state_path = os.path.join(self._context.state_dir,
             'mercurial/setup.lastcheck')
-        with open(state_path, 'a'):
+        open(state_path, 'a').__enter__()
+        if 1:
             os.utime(state_path, None)
 
+        open(state_path, 'a').__exit__(0, 0, 0)
         return result
diff -up mozilla-esr31/tools/profiler/LulElf.cpp.python3 mozilla-esr31/tools/profiler/LulElf.cpp
--- mozilla-esr31/tools/profiler/LulElf.cpp.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/profiler/LulElf.cpp	2014-09-05 15:26:14.114681217 +0200
@@ -69,6 +69,11 @@
 #include "LulElfInt.h"
 #include "LulMainInt.h"
 
+#ifndef NT_GNU_BUILD_ID
+#define NT_GNU_BUILD_ID 3
+#endif
+
+
 
 #if defined(LUL_PLAT_arm_android) && !defined(SHT_ARM_EXIDX)
 // bionic and older glibsc don't define it
diff -up mozilla-esr31/tools/rb/fix_stack_using_bpsyms.py.python3 mozilla-esr31/tools/rb/fix_stack_using_bpsyms.py
--- mozilla-esr31/tools/rb/fix_stack_using_bpsyms.py.python3	2014-08-25 15:17:29.000000000 +0200
+++ mozilla-esr31/tools/rb/fix_stack_using_bpsyms.py	2014-09-05 15:26:14.114681217 +0200
@@ -4,7 +4,7 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from __future__ import with_statement
+
 
 import sys
 import os
@@ -30,7 +30,8 @@ class SymbolFile:
     addrs = [] # list of addresses, which will be sorted once we're done initializing
     funcs = {} # hash: address --> (function name + possible file/line)
     files = {} # hash: filenum (string) --> prettified filename ready to have a line number appended
-    with open(fn) as f:
+    f = open(fn)
+    if 1:
       for line in f:
         line = line.rstrip()
         # http://code.google.com/p/google-breakpad/wiki/SymbolFiles
@@ -61,6 +62,7 @@ class SymbolFile:
           funcs[rva] = name
           addrs.append(rva)
         # skip everything else
+    f.close()
     #print "Loaded %d functions from symbol file %s" % (len(funcs), os.path.basename(fn))
     self.addrs = sorted(addrs)
     self.funcs = funcs
diff -up mozilla-esr31/xpcom/idl-parser/header.py.python3 mozilla-esr31/xpcom/idl-parser/header.py
--- mozilla-esr31/xpcom/idl-parser/header.py.python3	2014-08-25 15:17:30.000000000 +0200
+++ mozilla-esr31/xpcom/idl-parser/header.py	2014-09-05 15:26:14.114681217 +0200
@@ -159,7 +159,8 @@ forward_decl = """class %(name)s; /* for
 
 def idl_basename(f):
     """returns the base name of a file with the last extension stripped"""
-    return os.path.basename(f).rpartition('.')[0]
+    return ".".join(os.path.basename(f).split('.')[:-1])
+    #return os.path.basename(f).rpartition('.')[0]
 
 def print_header(idl, fd, filename):
     fd.write(header % {'filename': filename,
@@ -333,11 +334,18 @@ def write_interface(iface, fd):
 
         fd.write("  %s = 0;\n" % attributeAsNative(a, True))
         if a.infallible:
+            a_args = ''
+            if a.implicit_jscontext:
+              a_args = 'JSContext* cx'
+            a_argnames = ''
+            if a.implicit_jscontext:
+              a.implicit_jscontext = 'cx, '
             fd.write(attr_infallible_tmpl %
+
                      {'realtype': a.realtype.nativeType('in'),
                       'nativename': attributeNativeName(a, getter=True),
-                      'args': '' if not a.implicit_jscontext else 'JSContext* cx',
-                      'argnames': '' if not a.implicit_jscontext else 'cx, '})
+                      'args': a_args, 
+                      'argnames': a_argnames})
 
         if not a.readonly:
             fd.write("  %s = 0;\n" % attributeAsNative(a, False))
@@ -486,7 +494,11 @@ if __name__ == '__main__':
     o.add_option('--regen', action='store_true', dest='regen', default=False,
                  help="Regenerate IDL Parser cache")
     options, args = o.parse_args()
-    file = args[0] if args else None
+    file = None
+    if args:
+      file = args[0]
+    else:
+      file = None
 
     if options.cachedir is not None:
         if not os.path.isdir(options.cachedir):
diff -up mozilla-esr31/xpcom/idl-parser/typelib.py.python3 mozilla-esr31/xpcom/idl-parser/typelib.py
--- mozilla-esr31/xpcom/idl-parser/typelib.py.python3	2014-08-25 15:17:30.000000000 +0200
+++ mozilla-esr31/xpcom/idl-parser/typelib.py	2014-09-05 15:26:14.114681217 +0200
@@ -260,7 +260,11 @@ if __name__ == '__main__':
     o.add_option('--regen', action='store_true', dest='regen', default=False,
                  help="Regenerate IDL Parser cache")
     options, args = o.parse_args()
-    file = args[0] if args else None
+    file = None
+    if args:
+      file = args[0]
+    else:
+      file = None
 
     if options.cachedir is not None:
         if not os.path.isdir(options.cachedir):
diff -up mozilla-esr31/xpcom/typelib/xpt/tools/xpt.py.python3 mozilla-esr31/xpcom/typelib/xpt/tools/xpt.py
--- mozilla-esr31/xpcom/typelib/xpt/tools/xpt.py.python3	2014-08-25 15:17:30.000000000 +0200
+++ mozilla-esr31/xpcom/typelib/xpt/tools/xpt.py	2014-09-05 15:26:14.114681217 +0200
@@ -65,8 +65,9 @@ InterfaceType()        - construct a new
 
 """
 
-from __future__ import with_statement
+
 import os, sys
+import mystruct
 import struct
 import operator
 
@@ -102,7 +103,7 @@ class Type(object):
     this class directly. Rather, use one of its subclasses.
     
     """
-    _prefixdescriptor = struct.Struct(">B")
+    _prefixdescriptor = mystruct.Struct(">B")
     Tags = enum(
         # The first 18 entries are SimpleTypeDescriptor
         'int8',
@@ -263,7 +264,7 @@ class InterfaceType(Type):
     (InterfaceTypeDescriptor from the typelib specification.)
 
     """
-    _descriptor = struct.Struct(">H")
+    _descriptor = mystruct.Struct(">H")
 
     def __init__(self, iface, pointer=True, **kwargs):
         if not pointer:
@@ -315,7 +316,7 @@ class InterfaceIsType(Type):
     typelib specification.)
     
     """
-    _descriptor = struct.Struct(">B")
+    _descriptor = mystruct.Struct(">B")
     _cache = {}
 
     def __init__(self, param_index, pointer=True, **kwargs):
@@ -364,7 +365,7 @@ class ArrayType(Type):
     (ArrayTypeDescriptor from the typelib specification.)
     
     """
-    _descriptor = struct.Struct(">BB")
+    _descriptor = mystruct.Struct(">BB")
 
     def __init__(self, element_type, size_is_arg_num, length_is_arg_num,
                  pointer=True, **kwargs):
@@ -414,7 +415,7 @@ class StringWithSizeType(Type):
     from the typelib specification.)
 
     """
-    _descriptor = struct.Struct(">BB")
+    _descriptor = mystruct.Struct(">BB")
 
     def __init__(self, size_is_arg_num, length_is_arg_num,
                  pointer=True, **kwargs):
@@ -461,7 +462,7 @@ class WideStringWithSizeType(Type):
     (WideStringWithSizeTypeDescriptor from the typelib specification.)
 
     """
-    _descriptor = struct.Struct(">BB")
+    _descriptor = mystruct.Struct(">BB")
 
     def __init__(self, size_is_arg_num, length_is_arg_num,
                  pointer=True, **kwargs):
@@ -507,7 +508,7 @@ class Param(object):
     (ParamDescriptor from the typelib specification.)
 
     """
-    _descriptorstart = struct.Struct(">B")
+    _descriptorstart = mystruct.Struct(">B")
 
     def __init__(self, type, in_=True, out=False, retval=False,
                  shared=False, dipper=False, optional=False):
@@ -626,7 +627,7 @@ class Method(object):
     (MethodDescriptor from the typelib specification.)
     
     """
-    _descriptorstart = struct.Struct(">BIB")
+    _descriptorstart = mystruct.Struct(">BIB")
 
     def __init__(self, name, result,
                  params=[], getter=False, setter=False, notxpcom=False,
@@ -767,7 +768,7 @@ class Constant(object):
     (ConstantDesciptor from the typelib specification.)
 
     """
-    _descriptorstart = struct.Struct(">I")
+    _descriptorstart = mystruct.Struct(">I")
     # Actual value is restricted to this set of types
     #XXX: the spec lies, the source allows a bunch more
     # http://hg.mozilla.org/mozilla-central/annotate/9c85f9aaec8c/xpcom/typelib/xpt/src/xpt_struct.c#l689
@@ -801,7 +802,7 @@ class Constant(object):
         if isinstance(t, SimpleType) and t.tag in Constant.typemap:
             tt = Constant.typemap[t.tag]
             start = data_pool + offset - 1
-            (val,) = struct.unpack_from(tt, map, start)
+            (val,) = mystruct.unpack_from(tt, map, start)
             offset += struct.calcsize(tt)
             c = Constant(name, t, val)
         return c, offset
@@ -840,8 +841,8 @@ class Interface(object):
     (InterfaceDescriptor from the typelib specification.)
     
     """
-    _direntry = struct.Struct(">16sIII")
-    _descriptorstart = struct.Struct(">HH")
+    _direntry = mystruct.Struct(">16sIII")
+    _descriptorstart = mystruct.Struct(">HH")
 
     UNRESOLVED_IID = "00000000-0000-0000-0000-000000000000"
 
@@ -919,14 +920,14 @@ class Interface(object):
             self.methods.append(m)
         # Read constants
         start = data_pool + offset - 1
-        (num_constants, ) = struct.unpack_from(">H", map, start)
+        (num_constants, ) = mystruct.unpack_from(">H", map, start)
         offset = offset + struct.calcsize(">H")
         for i in range(num_constants):
             c, offset = Constant.read(typelib, map, data_pool, offset)
             self.constants.append(c)
         # Read flags
         start = data_pool + offset - 1
-        (flags, ) = struct.unpack_from(">B", map, start)
+        (flags, ) = mystruct.unpack_from(">B", map, start)
         offset = offset + struct.calcsize(">B")
         # only the first two bits are flags
         flags &= 0xE0
@@ -1011,7 +1012,7 @@ class Typelib(object):
     or the static Typelib.read method may be called to read one from a file.
 
     """
-    _header = struct.Struct(">16sBBHIII")
+    _header = mystruct.Struct(">16sBBHIII")
 
     def __init__(self, version=TYPELIB_VERSION, interfaces=[], annotations=[]):
         """
@@ -1067,10 +1068,12 @@ class Typelib(object):
         expected_size = None
         if isinstance(input_file, basestring):
             filename = input_file
-            with open(input_file, "rb") as f:
+            f = open(input_file, "rb")
+            if 1:
                 st = os.fstat(f.fileno())
                 data = f.read(st.st_size)
                 expected_size = st.st_size
+            f.__exit__(0, 0, 0)
         else:
             data = input_file.read()
 
@@ -1096,7 +1099,7 @@ class Typelib(object):
         # make a half-hearted attempt to read Annotations,
         # since XPIDL doesn't produce any anyway.
         start = Typelib._header.size
-        (anno, ) = struct.unpack_from(">B", data, start)
+        (anno, ) = mystruct.unpack_from(">B", data, start)
         islast = anno & 0x80
         tag = anno & 0x7F
         if tag == 0: # EmptyAnnotation
@@ -1184,8 +1187,10 @@ class Typelib(object):
         """
         self._sanityCheck()
         if isinstance(output_file, basestring):
-            with open(output_file, "wb") as f:
+            f = open(output_file, "wb")
+            if 1:
                 self.writefd(f)
+            f.close()
         else:
             self.writefd(output_file)