Merge "Use instanceof instead of type"
This commit is contained in:
@@ -351,7 +351,7 @@ def _merge_args(qCmd, parsed_args, _extra_values, value_specs):
|
|||||||
if isinstance(arg_value, list):
|
if isinstance(arg_value, list):
|
||||||
if value and isinstance(value, list):
|
if value and isinstance(value, list):
|
||||||
if (not arg_value or
|
if (not arg_value or
|
||||||
type(arg_value[0]) == type(value[0])):
|
isinstance(arg_value[0], type(value[0]))):
|
||||||
arg_value.extend(value)
|
arg_value.extend(value)
|
||||||
_extra_values.pop(key)
|
_extra_values.pop(key)
|
||||||
|
|
||||||
|
@@ -185,7 +185,7 @@ class ClientBase(object):
|
|||||||
# Add format and tenant_id
|
# Add format and tenant_id
|
||||||
action += ".%s" % self.format
|
action += ".%s" % self.format
|
||||||
action = self.action_prefix + action
|
action = self.action_prefix + action
|
||||||
if type(params) is dict and params:
|
if isinstance(params, dict) and params:
|
||||||
params = utils.safe_encode_dict(params)
|
params = utils.safe_encode_dict(params)
|
||||||
action += '?' + urlparse.urlencode(params, doseq=1)
|
action += '?' + urlparse.urlencode(params, doseq=1)
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ class ClientBase(object):
|
|||||||
"""
|
"""
|
||||||
if data is None:
|
if data is None:
|
||||||
return None
|
return None
|
||||||
elif type(data) is dict:
|
elif isinstance(data, dict):
|
||||||
return serializer.Serializer().serialize(data)
|
return serializer.Serializer().serialize(data)
|
||||||
else:
|
else:
|
||||||
raise Exception(_("Unable to serialize object of type = '%s'") %
|
raise Exception(_("Unable to serialize object of type = '%s'") %
|
||||||
|
Reference in New Issue
Block a user