diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2022-11-13 14:37:35 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-11-13 14:37:35 -0500 |
| commit | 9b8a6ef60b2b490bcf60b9dd7f0d43d46f49e489 (patch) | |
| tree | 56b90c20f19ca92c8d9c26e782c5969a7b872c48 /setuptools/_distutils/command/upload.py | |
| parent | a0e8e53cecc238e3bce2247308fe7dd94114ef35 (diff) | |
| parent | e0787fad7c03d8defbbaaaf2888130cc2a171537 (diff) | |
| download | python-setuptools-git-9b8a6ef60b2b490bcf60b9dd7f0d43d46f49e489.tar.gz | |
Merge https://github.com/pypa/distutils into distutils-e0787fa
Diffstat (limited to 'setuptools/_distutils/command/upload.py')
| -rw-r--r-- | setuptools/_distutils/command/upload.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/setuptools/_distutils/command/upload.py b/setuptools/_distutils/command/upload.py index 6af53943..16e15d8b 100644 --- a/setuptools/_distutils/command/upload.py +++ b/setuptools/_distutils/command/upload.py @@ -8,13 +8,13 @@ index). import os import io import hashlib +import logging from base64 import standard_b64encode from urllib.request import urlopen, Request, HTTPError from urllib.parse import urlparse -from distutils.errors import DistutilsError, DistutilsOptionError -from distutils.core import PyPIRCCommand -from distutils.spawn import spawn -from distutils import log +from ..errors import DistutilsError, DistutilsOptionError +from ..core import PyPIRCCommand +from ..spawn import spawn # PyPI Warehouse supports MD5, SHA256, and Blake2 (blake2-256) @@ -171,7 +171,7 @@ class upload(PyPIRCCommand): body = body.getvalue() msg = "Submitting {} to {}".format(filename, self.repository) - self.announce(msg, log.INFO) + self.announce(msg, logging.INFO) # build the Request headers = { @@ -190,16 +190,18 @@ class upload(PyPIRCCommand): status = e.code reason = e.msg except OSError as e: - self.announce(str(e), log.ERROR) + self.announce(str(e), logging.ERROR) raise if status == 200: - self.announce('Server response ({}): {}'.format(status, reason), log.INFO) + self.announce( + 'Server response ({}): {}'.format(status, reason), logging.INFO + ) if self.show_response: text = self._read_pypi_response(result) msg = '\n'.join(('-' * 75, text, '-' * 75)) - self.announce(msg, log.INFO) + self.announce(msg, logging.INFO) else: msg = 'Upload failed ({}): {}'.format(status, reason) - self.announce(msg, log.ERROR) + self.announce(msg, logging.ERROR) raise DistutilsError(msg) |
