From dd83afb86cb97c6ecfbd09136e257ccd22753b41 Mon Sep 17 00:00:00 2001 From: surajeet310 Date: Mon, 19 Jul 2021 21:22:27 +0000 Subject: [PATCH] Bug 1717651 - Removed 'ensure_subprocess_env()' from mozbuild/util.py r=mhentges 'ensure_subprocess_env()' is obsolete as Python 2 is no longer used in python/mozbuild . Differential Revision: https://phabricator.services.mozilla.com/D120102 --- python/mozbuild/mozbuild/util.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py index 9917d31fb6f5..19812f4055e1 100644 --- a/python/mozbuild/mozbuild/util.py +++ b/python/mozbuild/mozbuild/util.py @@ -1414,22 +1414,6 @@ def ensure_unicode(value, encoding="utf-8"): return value -def ensure_subprocess_env(env, encoding="utf-8"): - """Ensure the environment is in the correct format for the `subprocess` - module. - - This will convert all keys and values to bytes on Python 2, and text on - Python 3. - - Args: - env (dict): Environment to ensure. - encoding (str): Encoding to use when converting to/from bytes/text - (default: utf-8). - """ - ensure = ensure_bytes if sys.version_info[0] < 3 else ensure_unicode - return {ensure(k, encoding): ensure(v, encoding) for k, v in six.iteritems(env)} - - def process_time(): if six.PY2: return time.clock()