diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2013-09-29 17:48:14 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2013-09-29 17:48:14 -0400 |
| commit | ef7a80865f253852f7c7b01f04bc02b695ead67b (patch) | |
| tree | ea718f746b5f9db4624057d1f0aa1df9abee8bd4 /requests/packages/urllib3/contrib/ntlmpool.py | |
| parent | 19346fa9068878af516cdb670bea4f791337507b (diff) | |
| download | lastfm-ef7a80865f253852f7c7b01f04bc02b695ead67b.tar.gz | |
Giving up on Python 2.5 support
Diffstat (limited to 'requests/packages/urllib3/contrib/ntlmpool.py')
| -rw-r--r-- | requests/packages/urllib3/contrib/ntlmpool.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/requests/packages/urllib3/contrib/ntlmpool.py b/requests/packages/urllib3/contrib/ntlmpool.py index c5f010e..b8cd933 100644 --- a/requests/packages/urllib3/contrib/ntlmpool.py +++ b/requests/packages/urllib3/contrib/ntlmpool.py @@ -1,5 +1,5 @@ # urllib3/contrib/ntlmpool.py -# Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt) +# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -10,7 +10,10 @@ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ -import httplib +try: + from http.client import HTTPSConnection +except ImportError: + from httplib import HTTPSConnection from logging import getLogger from ntlm import ntlm @@ -30,7 +33,7 @@ class NTLMConnectionPool(HTTPSConnectionPool): def __init__(self, user, pw, authurl, *args, **kwargs): """ authurl is a random URL on the server that is protected by NTLM. - user is the Windows user, probably in the DOMAIN\username format. + user is the Windows user, probably in the DOMAIN\\username format. pw is the password for the user. """ super(NTLMConnectionPool, self).__init__(*args, **kwargs) @@ -53,7 +56,7 @@ class NTLMConnectionPool(HTTPSConnectionPool): req_header = 'Authorization' resp_header = 'www-authenticate' - conn = httplib.HTTPSConnection(host=self.host, port=self.port) + conn = HTTPSConnection(host=self.host, port=self.port) # Send negotiation message headers[req_header] = ( |
