diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-20 22:55:16 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-20 22:55:16 +0100 |
commit | 58a658b26d1c95b31d02050dcccd648d2e4ce27b (patch) | |
tree | b9d3e7de6f6d23b91a7afecde3491e99d8cc7069 /setuptools/command/upload_docs.py | |
parent | e63f3e7d864b26529d6b197e053b4084be20decf (diff) | |
download | external_python_setuptools-58a658b26d1c95b31d02050dcccd648d2e4ce27b.tar.gz external_python_setuptools-58a658b26d1c95b31d02050dcccd648d2e4ce27b.tar.bz2 external_python_setuptools-58a658b26d1c95b31d02050dcccd648d2e4ce27b.zip |
Changes to support 2.x and 3.x in the same codebase.
--HG--
branch : distribute
extra : rebase_source : 7d3608edee54a43789f0574d702fb839628b5071
Diffstat (limited to 'setuptools/command/upload_docs.py')
-rw-r--r-- | setuptools/command/upload_docs.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index 213f7b58..505ddadb 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -8,9 +8,7 @@ PyPI's packages.python.org). import os import socket import zipfile -import httplib import base64 -import urlparse import tempfile import sys @@ -22,6 +20,8 @@ try: except ImportError: from setuptools.command.upload import upload +from setuptools.compat import httplib, urlparse + _IS_PYTHON3 = sys.version > '3' try: @@ -137,7 +137,7 @@ class upload_docs(upload): # We can't use urllib2 since we need to send the Basic # auth right with the first request schema, netloc, url, params, query, fragments = \ - urlparse.urlparse(self.repository) + urlparse(self.repository) assert not params and not query and not fragments if schema == 'http': conn = httplib.HTTPConnection(netloc) @@ -157,7 +157,8 @@ class upload_docs(upload): conn.putheader('Authorization', auth) conn.endheaders() conn.send(body) - except socket.error, e: + except socket.error: + e = sys.exc_info()[1] self.announce(str(e), log.ERROR) return @@ -175,4 +176,4 @@ class upload_docs(upload): self.announce('Upload failed (%s): %s' % (r.status, r.reason), log.ERROR) if self.show_response: - print '-'*75, r.read(), '-'*75 + print('-'*75, r.read(), '-'*75) |