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.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py
index 6df3f394..a75c3b7e 100644
--- a/setuptools/command/upload_docs.py
+++ b/setuptools/command/upload_docs.py
@@ -8,8 +8,6 @@ PyPI's pythonhosted.org).
import os
import socket
import zipfile
-import httplib
-import urlparse
import tempfile
import sys
import shutil
@@ -25,6 +23,9 @@ try:
except ImportError:
from setuptools.command.upload import upload
+from setuptools.compat import httplib, urlparse
+
+_IS_PYTHON3 = sys.version > '3'
# This is not just a replacement for byte literals
# but works as a general purpose encoder
@@ -154,7 +155,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)
@@ -174,7 +175,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
@@ -192,4 +194,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)