diff options
author | Clint Byrum <clint@fewbar.com> | 2015-05-15 11:44:03 -0700 |
---|---|---|
committer | Clint Byrum <clint@fewbar.com> | 2015-05-15 11:52:15 -0700 |
commit | ea94fb4e795245d1801d2d2b1faf6f94009e09cf (patch) | |
tree | ebd7b4d8f773c6c6df74ed511ceb7db1109791bc /src/saml2/httpbase.py | |
parent | 45f88c16268ccf8a6c106b1ea20e84515c74e476 (diff) | |
download | pysaml2-ea94fb4e795245d1801d2d2b1faf6f94009e09cf.tar.gz |
Deal with renamed modules in python3
six.moves handles some of the reorganized modules.
With dircache, it was simply removed as it has been deprecated for a
long time. os.listdir performs fine these days.
Diffstat (limited to 'src/saml2/httpbase.py')
-rw-r--r-- | src/saml2/httpbase.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/saml2/httpbase.py b/src/saml2/httpbase.py index fe50b1d8..79d4ba00 100644 --- a/src/saml2/httpbase.py +++ b/src/saml2/httpbase.py @@ -1,12 +1,12 @@ import calendar -import cookielib +from six.moves import http_cookiejar import copy import re import urllib -import urlparse +from six.moves.urllib.parse import urlparse import requests import time -from Cookie import SimpleCookie +from six.moves.http_cookies import SimpleCookie from saml2.time_util import utc_now from saml2 import class_name, SAMLError from saml2.pack import http_form_post_message @@ -98,7 +98,7 @@ class HTTPBase(object): cert_file=None): self.request_args = {"allow_redirects": False} #self.cookies = {} - self.cookiejar = cookielib.CookieJar() + self.cookiejar = http_cookiejar.CookieJar() self.request_args["verify"] = verify if verify: @@ -118,7 +118,7 @@ class HTTPBase(object): :param url: :return: """ - part = urlparse.urlparse(url) + part = urlparse(url) #if part.port: # _domain = "%s:%s" % (part.hostname, part.port) @@ -143,12 +143,12 @@ class HTTPBase(object): return cookie_dict def set_cookie(self, kaka, request): - """Returns a cookielib.Cookie based on a set-cookie header line""" + """Returns a http_cookiejar.Cookie based on a set-cookie header line""" if not kaka: return - part = urlparse.urlparse(request.url) + part = urlparse(request.url) _domain = part.hostname logger.debug("%s: '%s'" % (_domain, kaka)) @@ -205,7 +205,7 @@ class HTTPBase(object): except ValueError: pass else: - new_cookie = cookielib.Cookie(**std_attr) + new_cookie = http_cookiejar.Cookie(**std_attr) self.cookiejar.set_cookie(new_cookie) def send(self, url, method="GET", **kwargs): |