Bug 1547730 - do s/StringIO.StringIO/six.StringIO/ to support py3 r=#build
☠☠ backed out by ee4b88439111 ☠ ☠
authorJustin Wood <Callek@gmail.com>
Sun, 14 Apr 2019 22:18:34 -0400
changeset 533006 aa2acfd554fccc899c45ab29d5fb4f7062b00167
parent 533005 fa39fb43fd1284eb017291717bb4ae85fdb4b09b
child 533007 b7b1062d0aad633e369d12613e8919b5e44d4c28
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1547730
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547730 - do s/StringIO.StringIO/six.StringIO/ to support py3 r=#build Differential Revision: https://phabricator.services.mozilla.com/D28101
python/mozbuild/mozbuild/base.py
python/mozbuild/mozpack/test/test_files.py
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -14,17 +14,16 @@ import subprocess
 import sys
 import errno
 try:
     from shutil import which
 except ImportError:
     # shutil.which is not available in Python 2.7
     import which
 
-from StringIO import StringIO
 from mach.mixin.process import ProcessExecutionMixin
 from mozversioncontrol import (
     get_repository_from_build_config,
     get_repository_object,
     InvalidRepoPath,
 )
 
 from .backend.configenvironment import ConfigEnvironment
@@ -268,17 +267,17 @@ class MozbuildObject(ProcessExecutionMix
 
     @staticmethod
     @memoize
     def get_mozconfig_and_target(topsrcdir, path, env_mozconfig):
         # env_mozconfig is only useful for unittests, which change the value of
         # the environment variable, which has an impact on autodetection (when
         # path is MozconfigLoader.AUTODETECT), and memoization wouldn't account
         # for it without the explicit (unused) argument.
-        out = StringIO()
+        out = six.StringIO()
         env = os.environ
         if path and path != MozconfigLoader.AUTODETECT:
             env = dict(env)
             env['MOZCONFIG'] = path
 
         # We use python configure to get mozconfig content and the value for
         # --target (from mozconfig if necessary, guessed otherwise).
 
--- a/python/mozbuild/mozpack/test/test_files.py
+++ b/python/mozbuild/mozpack/test/test_files.py
@@ -55,22 +55,22 @@ from mozpack.chrome.manifest import (
     ManifestLocale,
     ManifestOverride,
 )
 import unittest
 import mozfile
 import mozunit
 import os
 import random
+import six
 import sys
 import tarfile
 import mozpack.path as mozpath
 from tempfile import mkdtemp
 from io import BytesIO
-from StringIO import StringIO
 
 
 class TestWithTmpDir(unittest.TestCase):
     def setUp(self):
         self.tmpdir = mkdtemp()
 
         self.symlink_supported = False
         self.hardlink_supported = False
@@ -916,17 +916,17 @@ class TestMinifiedJavaScript(TestWithTmp
                                    verify_command=self._verify_command('0'))
 
         mini_lines = min_f.open().readlines()
         self.assertTrue(mini_lines)
         self.assertTrue(len(mini_lines) < len(self.orig_lines))
 
     def test_minified_verify_failure(self):
         orig_f = GeneratedFile(b'\n'.join(self.orig_lines))
-        errors.out = StringIO()
+        errors.out = six.StringIO()
         min_f = MinifiedJavaScript(orig_f,
                                    verify_command=self._verify_command('1'))
 
         mini_lines = min_f.open().readlines()
         output = errors.out.getvalue()
         errors.out = sys.stderr
         self.assertEqual(output,
                          'Warning: JS minification verification failed for <unknown>:\n'