Bug 1576097 - Remove mozbuild.util.encode again. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 23 Aug 2019 16:43:58 +0000
changeset 489674 014630236d2de0057ecc97598243747d6f419701
parent 489673 c4c43bf71488d253bd9035afdff47c5c0d31aa45
child 489675 a1378c3569f386dd7ccf1ab2989306ea45454690
push id36479
push useraciure@mozilla.com
push dateSat, 24 Aug 2019 09:49:46 +0000
treeherdermozilla-central@ea3eebc73ccb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1576097 - Remove mozbuild.util.encode again. r=nalexander This time, existing config.status trying to import it will throw an exception that will trigger a re-configure. Differential Revision: https://phabricator.services.mozilla.com/D43215
--- a/python/mozbuild/mozbuild/util.py
+++ b/python/mozbuild/mozbuild/util.py
@@ -18,17 +18,16 @@ import itertools
 import os
 import re
 import six
 import stat
 import sys
 import time
 from collections import (
-    Iterable,
 from io import (
@@ -1292,34 +1291,16 @@ def indented_repr(o, indent=4):
                 yield ',\n'
             yield one_indent * level
             yield ']'
             yield repr(o)
     return ''.join(recurse_indented_repr(o, 0))
-# Please do not use this function. It's only kept for backwards compatibility
-# with older config.status files that may lay around before a CLOBBER.
-def encode(obj, encoding='utf-8'):
-    '''Recursively encode unicode strings with the given encoding.'''
-    if isinstance(obj, dict):
-        return {
-            encode(k, encoding): encode(v, encoding)
-            for k, v in six.iteritems(obj)
-        }
-    if isinstance(obj, bytes):
-        return obj
-    if isinstance(obj, six.text_type):
-        return obj.encode(encoding)
-    if isinstance(obj, Iterable):
-        return [encode(i, encoding) for i in obj]
-    return obj
 def patch_main():
     '''This is a hack to work around the fact that Windows multiprocessing needs
     to import the original main module, and assumes that it corresponds to a file
     ending in .py.
     We do this by a sort of two-level function interposing. The first
     level interposes forking.get_command_line() with our version defined
     in my_get_command_line(). Our version of get_command_line will