diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-06-15 15:34:53 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-06-15 15:34:53 +0100 |
commit | 8e657eac1ef02faedca99df319fff6b63f4a4305 (patch) | |
tree | f3f2ed97342421c6b65c9caaab8ae5d830f04059 /setuptools/command/upload.py | |
parent | c04abca662dcbffd00d928e06fbf32b9f49f8e57 (diff) | |
download | external_python_setuptools-8e657eac1ef02faedca99df319fff6b63f4a4305.tar.gz external_python_setuptools-8e657eac1ef02faedca99df319fff6b63f4a4305.tar.bz2 external_python_setuptools-8e657eac1ef02faedca99df319fff6b63f4a4305.zip |
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
Diffstat (limited to 'setuptools/command/upload.py')
-rwxr-xr-x | setuptools/command/upload.py | 15 |
1 files changed, 6 insertions, 9 deletions
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) |