aboutsummaryrefslogtreecommitdiff
path: root/wa/utils
diff options
context:
space:
mode:
authorSergei Trofimov <sergei.trofimov@arm.com>2018-06-12 13:24:53 +0100
committersetrofim <setrofim@gmail.com>2018-06-12 13:27:19 +0100
commit657a10c09d47d9e7ddd14af3339f3b2855780fd7 (patch)
tree99cd10e4d34c33233cd735ec71ab1d7ddab15dde /wa/utils
parentb6531feb52ea25ef501c5409efb5aec54c5115f2 (diff)
utils/serializer: fix level deserialization
Fix a regression introduced with Python 3 port -- JSON deserializer should check for basestring rather than str when deciding whether to try to decode a custom type.
Diffstat (limited to 'wa/utils')
-rw-r--r--wa/utils/serializer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wa/utils/serializer.py b/wa/utils/serializer.py
index 1b7c1a74..b9147004 100644
--- a/wa/utils/serializer.py
+++ b/wa/utils/serializer.py
@@ -50,6 +50,8 @@ from datetime import datetime
import yaml as _yaml
import dateutil.parser
+from past.builtins import basestring
+
from wa.framework.exception import SerializerSyntaxError
from wa.utils.misc import isiterable
from wa.utils.types import regex_type, none_type, level, cpu_mask
@@ -104,7 +106,7 @@ class WAJSONDecoder(_json.JSONDecoder):
d = _json.JSONDecoder.decode(self, s, **kwargs)
def try_parse_object(v):
- if isinstance(v, str):
+ if isinstance(v, basestring):
if v.startswith('REGEX:'):
_, flags, pattern = v.split(':', 2)
return re.compile(pattern, int(flags or 0))