Skip to content

Commit e41a593

Browse files
author
Roland Hedberg
committed
PY3&PY2 thing
1 parent 3252037 commit e41a593

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

example/sp-wsgi/sp.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
import re
55
import argparse
66
import os
7+
from future.backports.http.cookies import SimpleCookie
8+
import six
9+
710
from saml2.extension.pefim import SPCertEnc
811
from saml2.metadata import create_metadata_string
912
import service_conf
1013

11-
from Cookie import SimpleCookie
12-
from urlparse import parse_qs
14+
from six.moves.urllib.parse import parse_qs
1315
import sys
1416

1517
from saml2 import BINDING_HTTP_REDIRECT, element_to_extension_element
@@ -59,7 +61,7 @@ def dict_to_table(ava, lev=0, width=1):
5961
txt = ['<table border=%s bordercolor="black">\n' % width]
6062
for prop, valarr in ava.items():
6163
txt.append("<tr>\n")
62-
if isinstance(valarr, basestring):
64+
if isinstance(valarr, six.string_types):
6365
txt.append("<th>%s</th>\n" % str(prop))
6466
try:
6567
txt.append("<td>%s</td>\n" % valarr.encode("utf8"))

0 commit comments

Comments
 (0)