FIX: Get rid of basestring (not python3 compatible).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import datetime
|
||||
import logging
|
||||
import re
|
||||
from six import string_types
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -53,7 +54,7 @@ class Iso8601Serializer(object):
|
||||
@classmethod
|
||||
def deserialize(cls, value, ignore_unsupported_input=False):
|
||||
prefix = '{marker}{sep}'.format(marker=cls.marker, sep=cls.separator)
|
||||
if isinstance(value, basestring) and value.startswith(prefix):
|
||||
if isinstance(value, string_types) and value.startswith(prefix):
|
||||
haystack = value[len(prefix):]
|
||||
m = cls._re.match(haystack)
|
||||
if m is not None:
|
||||
@@ -68,6 +69,6 @@ class Iso8601Serializer(object):
|
||||
elif not ignore_unsupported_input:
|
||||
raise ValueError('Format not recognized \'{str}\''.format(str=haystack))
|
||||
elif not ignore_unsupported_input:
|
||||
raise ValueError('Expected basestring,'
|
||||
raise ValueError('Expected string type,'
|
||||
' not {}'.format(value.__class__.__name__))
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user