From 8e657eac1ef02faedca99df319fff6b63f4a4305 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Sat, 15 Jun 2013 15:34:53 +0100 Subject: Initial commit. All tests pass on 2.7, 3.2 and 3.3, though there are some atexit errors in the multiprocessing module in 2.7/3.2 (seemingly unrelated to setuptools). --HG-- branch : single-codebase --- setuptools/command/upload.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'setuptools/command/upload.py') diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 4b500f68..7ef0e6ec 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -13,11 +13,9 @@ except ImportError: import os import socket import platform -import ConfigParser -import httplib import base64 -import urlparse -import cStringIO as StringIO + +from setuptools.compat import urlparse, StringIO, httplib, ConfigParser class upload(Command): @@ -49,7 +47,7 @@ class upload(Command): raise DistutilsOptionError( "Must use --sign for --identity to have meaning" ) - if os.environ.has_key('HOME'): + if 'HOME' in os.environ: rc = os.path.join(os.environ['HOME'], '.pypirc') if os.path.exists(rc): self.announce('Using PyPI login from %s' % rc) @@ -149,14 +147,14 @@ class upload(Command): # 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': http = httplib.HTTPConnection(netloc) elif schema == 'https': http = httplib.HTTPSConnection(netloc) else: - raise AssertionError, "unsupported schema "+schema + raise AssertionError("unsupported schema " + schema) data = '' loglevel = log.INFO @@ -181,5 +179,4 @@ class upload(Command): 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) -- cgit v1.2.3