mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 11:22:41 +01:00
Remove Python 2 support
Python 2 is long dead and devlib does not support it anymore, so cleanup old Python 2-only code.
This commit is contained in:
committed by
Marc Bonnici
parent
28b78a93f1
commit
6fe4bce68d
@@ -244,10 +244,7 @@ class Http(ResourceGetter):
|
||||
response.status_code,
|
||||
response.reason))
|
||||
return {}
|
||||
if sys.version_info[0] == 3:
|
||||
content = response.content.decode('utf-8')
|
||||
else:
|
||||
content = response.content
|
||||
content = response.content.decode('utf-8')
|
||||
return json.loads(content)
|
||||
|
||||
def download_asset(self, asset, owner_name):
|
||||
|
@@ -325,10 +325,7 @@ def install(instrument, context):
|
||||
if not callable(attr):
|
||||
msg = 'Attribute {} not callable in {}.'
|
||||
raise ValueError(msg.format(attr_name, instrument))
|
||||
if sys.version_info[0] == 3:
|
||||
argspec = inspect.getfullargspec(attr)
|
||||
else:
|
||||
argspec = inspect.getargspec(attr) # pylint: disable=deprecated-method
|
||||
argspec = inspect.getfullargspec(attr)
|
||||
arg_num = len(argspec.args)
|
||||
# Instrument callbacks will be passed exactly two arguments: self
|
||||
# (the instrument instance to which the callback is bound) and
|
||||
|
@@ -57,7 +57,4 @@ def get_commit():
|
||||
p.wait()
|
||||
if p.returncode:
|
||||
return None
|
||||
if sys.version_info[0] == 3 and isinstance(std, bytes):
|
||||
return std[:8].decode(sys.stdout.encoding or 'utf-8')
|
||||
else:
|
||||
return std[:8]
|
||||
return std[:8].decode(sys.stdout.encoding or 'utf-8')
|
||||
|
Reference in New Issue
Block a user