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/identifier.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/identifier.py')
-rw-r--r-- | pycadf/identifier.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pycadf/identifier.py b/pycadf/identifier.py index 1c59234..7b76708 100644 --- a/pycadf/identifier.py +++ b/pycadf/identifier.py @@ -15,6 +15,8 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +import six import uuid from oslo.config import cfg @@ -43,6 +45,6 @@ def norm_ns(str_id): # TODO(mrutkows): validate any cadf:Identifier (type) record against # CADF schema. This would include schema validation as an optional parm. def is_valid(value): - if not isinstance(value, basestring): + if not isinstance(value, six.string_types): raise TypeError return True |