diff options
author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-01-06 20:40:44 +0100 |
---|---|---|
committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-01-06 22:32:04 +0100 |
commit | bc6ab131b5f0a89776c5b4670788fd3beab24073 (patch) | |
tree | c53d294e9f88d5a9aa81a0873c79b61ede8aeedf /pycadf/attachment.py | |
parent | e4fa4b5248a594f8cc0839b06b77c4828bea2cd1 (diff) | |
download | pycadf-bc6ab131b5f0a89776c5b4670788fd3beab24073.tar.gz |
Python 3: replace 'basestring' by 'six.string_types'
'basestring' will only work in Python 2. Using 'six.string_types' instead makes
the code compatible with both Python 2 and 3.
Change-Id: I572506ce6d0cc7570dc264711d19619746949d49
Diffstat (limited to 'pycadf/attachment.py')
-rw-r--r-- | pycadf/attachment.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pycadf/attachment.py b/pycadf/attachment.py index 0191471..8519867 100644 --- a/pycadf/attachment.py +++ b/pycadf/attachment.py @@ -16,6 +16,8 @@ # License for the specific language governing permissions and limitations # under the License. +import six + from pycadf import cadftype ATTACHMENT_KEYNAME_TYPEURI = "typeURI" @@ -33,12 +35,12 @@ class Attachment(cadftype.CADFAbstractType): # the set of approved attachment types in order to # limit and validate them. typeURI = cadftype.ValidatorDescriptor(ATTACHMENT_KEYNAME_TYPEURI, - lambda x: isinstance(x, - basestring)) + lambda x: isinstance( + x, six.string_types)) content = cadftype.ValidatorDescriptor(ATTACHMENT_KEYNAME_CONTENT) name = cadftype.ValidatorDescriptor(ATTACHMENT_KEYNAME_NAME, lambda x: isinstance(x, - basestring)) + six.string_types)) def __init__(self, typeURI=None, content=None, name=None): # Attachment.typeURI |