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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user