]> granicus.if.org Git - python/commitdiff
[2.7] bpo-21060 Improve error message for "setup.py upload" without dist files (GH...
authorÉric Araujo <merwok@netwok.org>
Mon, 19 Feb 2018 03:56:06 +0000 (22:56 -0500)
committerMariatta <Mariatta@users.noreply.github.com>
Mon, 19 Feb 2018 03:56:06 +0000 (19:56 -0800)
(cherry picked from commit 08a6926b2584040fe3c3f06263b0b5f1fbbdc24c)

Co-authored-by: Éric Araujo <merwok@netwok.org>
Lib/distutils/command/upload.py
Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst [new file with mode: 0644]

index ea4b8a551a60f35dd29d98d7f2a271c67df96ebc..ff043d2e125223fcdfc1ecdb7165c84f8cae4efe 100644 (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)
 
diff --git a/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst b/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst
new file mode 100644 (file)
index 0000000..4e0a113
--- /dev/null
@@ -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".