diff options
author | Philip Thiem <ptthiem@gmail.com> | 2013-09-28 12:33:19 -0500 |
---|---|---|
committer | Philip Thiem <ptthiem@gmail.com> | 2013-09-28 12:33:19 -0500 |
commit | 78f01306a08285e9f2abe6ad749f6ce884e12555 (patch) | |
tree | c4769869539d5ae9101a7e8e76a46e9e292b9b97 /setuptools/command/upload.py | |
parent | 30bb58f069cf1624f35cfbdb725e8e443ff64330 (diff) | |
parent | 49ce80613b7fcffd1882f7fb082e5bcc30e976f0 (diff) | |
download | python-setuptools-git-78f01306a08285e9f2abe6ad749f6ce884e12555.tar.gz |
Merge with default
--HG--
extra : rebase_source : d9c70d5bebd4290f568c828c5bc3a9b93a817ff2
Diffstat (limited to 'setuptools/command/upload.py')
-rwxr-xr-x | setuptools/command/upload.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 02d955ed..a6eff385 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -2,10 +2,10 @@ Implements the Distutils 'upload' subcommand (upload package to PyPI).""" -from distutils.errors import * +from distutils import errors +from distutils import log from distutils.core import Command from distutils.spawn import spawn -from distutils import log try: from hashlib import md5 except ImportError: @@ -45,7 +45,7 @@ class upload(Command): def finalize_options(self): if self.identity and not self.sign: - raise DistutilsOptionError( + raise errors.DistutilsOptionError( "Must use --sign for --identity to have meaning" ) if 'HOME' in os.environ: @@ -68,7 +68,7 @@ class upload(Command): def run(self): if not self.distribution.dist_files: - raise DistutilsOptionError("No dist file created in earlier command") + raise errors.DistutilsOptionError("No dist file created in earlier command") for command, pyversion, filename in self.distribution.dist_files: self.upload_file(command, pyversion, filename) @@ -119,10 +119,10 @@ class upload(Command): boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = '\n--' + boundary end_boundary = sep_boundary + '--' - body = StringIO.StringIO() + body = StringIO() for key, value in data.items(): # handle multiple entries for the same name - if type(value) != type([]): + if not isinstance(value, list): value = [value] for value in value: if type(value) is tuple: @@ -158,7 +158,6 @@ class upload(Command): raise AssertionError("unsupported schema " + schema) data = '' - loglevel = log.INFO try: http.connect() http.putrequest("POST", url) |