summaryrefslogtreecommitdiff
path: root/pycadf/identifier.py
diff options
context:
space:
mode:
authorCyril Roelandt <cyril.roelandt@enovance.com>2014-01-06 20:40:44 +0100
committerCyril Roelandt <cyril.roelandt@enovance.com>2014-01-06 22:32:04 +0100
commitbc6ab131b5f0a89776c5b4670788fd3beab24073 (patch)
treec53d294e9f88d5a9aa81a0873c79b61ede8aeedf /pycadf/identifier.py
parente4fa4b5248a594f8cc0839b06b77c4828bea2cd1 (diff)
downloadpycadf-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.py4
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