Merge "Fix types issue for Python 2/3 compatible code."
This commit is contained in:
commit
829fb06122
@ -38,7 +38,6 @@ import functools
|
||||
import inspect
|
||||
import itertools
|
||||
import json
|
||||
import types
|
||||
import xmlrpclib
|
||||
|
||||
import six
|
||||
@ -52,7 +51,7 @@ _nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod,
|
||||
inspect.iscode, inspect.isbuiltin, inspect.isroutine,
|
||||
inspect.isabstract]
|
||||
|
||||
_simple_types = (types.NoneType, six.integer_types, basestring, bool, float)
|
||||
_simple_types = (type(None), six.integer_types, basestring, bool, float)
|
||||
|
||||
|
||||
def to_primitive(value, convert_instances=False, convert_datetime=True,
|
||||
|
@ -743,7 +743,7 @@ def _call(addr, context, topic, msg, timeout=None,
|
||||
# One effect of this is that we're checking all
|
||||
# responses for Exceptions.
|
||||
for resp in responses:
|
||||
if isinstance(resp, types.DictType) and 'exc' in resp:
|
||||
if isinstance(resp, dict) and 'exc' in resp:
|
||||
raise rpc_common.deserialize_remote_exception(CONF, resp['exc'])
|
||||
|
||||
return responses[-1]
|
||||
|
Loading…
x
Reference in New Issue
Block a user