summaryrefslogtreecommitdiff
path: root/pycadf/endpoint.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/endpoint.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/endpoint.py')
-rw-r--r--pycadf/endpoint.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pycadf/endpoint.py b/pycadf/endpoint.py
index 2528767..95f9895 100644
--- a/pycadf/endpoint.py
+++ b/pycadf/endpoint.py
@@ -14,6 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import six
+
from pycadf import cadftype
TYPE_URI_ENDPOINT = cadftype.CADF_VERSION_1_0_0 + 'endpoint'
@@ -30,11 +32,11 @@ ENDPOINT_KEYNAMES = [ENDPOINT_KEYNAME_URL,
class Endpoint(cadftype.CADFAbstractType):
url = cadftype.ValidatorDescriptor(
- ENDPOINT_KEYNAME_URL, lambda x: isinstance(x, basestring))
+ ENDPOINT_KEYNAME_URL, lambda x: isinstance(x, six.string_types))
name = cadftype.ValidatorDescriptor(
- ENDPOINT_KEYNAME_NAME, lambda x: isinstance(x, basestring))
+ ENDPOINT_KEYNAME_NAME, lambda x: isinstance(x, six.string_types))
port = cadftype.ValidatorDescriptor(
- ENDPOINT_KEYNAME_PORT, lambda x: isinstance(x, basestring))
+ ENDPOINT_KEYNAME_PORT, lambda x: isinstance(x, six.string_types))
def __init__(self, url, name=None, port=None):