summaryrefslogtreecommitdiff
path: root/src/saml2/pack.py
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2015-05-20 23:31:17 -0700
committerClint Byrum <clint@fewbar.com>2015-05-21 00:13:26 -0700
commit9c91638891c9b29d8b1b7032422af5f8aa596fd9 (patch)
tree0400e8120c655adda51797da34e59cf292d3bcbe /src/saml2/pack.py
parent3db1cb25d83e3665d030b1b81a5f1c0755cb1aa6 (diff)
downloadpysaml2-9c91638891c9b29d8b1b7032422af5f8aa596fd9.tar.gz
Fix more basestring py3k issues
basestring has been removed from python 3.
Diffstat (limited to 'src/saml2/pack.py')
-rw-r--r--src/saml2/pack.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/saml2/pack.py b/src/saml2/pack.py
index f045c7a8..7c6b957f 100644
--- a/src/saml2/pack.py
+++ b/src/saml2/pack.py
@@ -20,6 +20,7 @@ import logging
from saml2.sigver import REQ_ORDER
from saml2.sigver import RESP_ORDER
from saml2.sigver import SIGNER_ALGS
+import six
logger = logging.getLogger(__name__)
@@ -57,7 +58,7 @@ def http_form_post_message(message, location, relay_state="",
"""
response = ["<head>", """<title>SAML 2.0 POST</title>""", "</head><body>"]
- if not isinstance(message, basestring):
+ if not isinstance(message, six.string_types):
message = "%s" % (message,)
if typ == "SAMLRequest" or typ == "SAMLResponse":
@@ -94,7 +95,7 @@ def http_redirect_message(message, location, relay_state="", typ="SAMLRequest",
:return: A tuple containing header information and a HTML message.
"""
- if not isinstance(message, basestring):
+ if not isinstance(message, six.string_types):
message = "%s" % (message,)
_order = None
@@ -163,7 +164,7 @@ def make_soap_enveloped_saml_thingy(thingy, header_parts=None):
body.tag = '{%s}Body' % NAMESPACE
envelope.append(body)
- if isinstance(thingy, basestring):
+ if isinstance(thingy, six.string_types):
# remove the first XML version/encoding line
logger.debug("thingy0: %s" % thingy)
_part = thingy.split("\n")