Skip to content

Commit 2a93fae

Browse files
Improve error message for "setup.py upload" without dist files (GH-21060)
(cherry picked from commit 08a6926) Co-authored-by: Éric Araujo <[email protected]>
1 parent 5c81ed4 commit 2a93fae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Lib/distutils/command/upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def finalize_options(self):
5757

5858
def run(self):
5959
if not self.distribution.dist_files:
60-
msg = "No dist file created in earlier command"
60+
msg = ("Must create and upload files in one command "
61+
"(e.g. setup.py sdist upload)")
6162
raise DistutilsOptionError(msg)
6263
for command, pyversion, filename in self.distribution.dist_files:
6364
self.upload_file(command, pyversion, filename)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Rewrite confusing message from setup.py upload from
2+
"No dist file created in earlier command" to the more helpful
3+
"Must create and upload files in one command".

0 commit comments

Comments
 (0)