From ef7a80865f253852f7c7b01f04bc02b695ead67b Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Sun, 29 Sep 2013 17:48:14 -0400 Subject: Giving up on Python 2.5 support --- requests/packages/urllib3/contrib/ntlmpool.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'requests/packages/urllib3/contrib/ntlmpool.py') 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] = ( -- cgit v1.2.3-70-g09d2