aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/upload_docs.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/upload_docs.py')
-rw-r--r--setuptools/command/upload_docs.py11
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)