[2.7] bpo-21060 Improve error message for "setup.py upload" without dist files (GH-5726).

(cherry picked from commit 08a6926b25)

Co-authored-by: Éric Araujo <merwok@netwok.org>
This commit is contained in:
Éric Araujo
2018-02-18 22:56:06 -05:00
committed by Mariatta
parent 21f53e7249
commit eeb33651bf
2 changed files with 6 additions and 1 deletions

View File

@@ -55,7 +55,9 @@ class upload(PyPIRCCommand):
def run(self):
if not self.distribution.dist_files:
raise DistutilsOptionError("No dist file created in earlier command")
msg = ("Must create and upload files in one command "
"(e.g. setup.py sdist upload)")
raise DistutilsOptionError(msg)
for command, pyversion, filename in self.distribution.dist_files:
self.upload_file(command, pyversion, filename)

View File

@@ -0,0 +1,3 @@
Rewrite confusing message from setup.py upload from
"No dist file created in earlier command" to the more helpful
"Must create and upload files in one command".