Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a5f3a69

Browse filesBrowse files
committed
Fix: All python -m semver commands fail with 'error: invalid choice:'
This was caused by __main__.py passing `sys.argv` to `cli.main()`, which includes the path of the script in `sys.argv[0]`. `argparse.ArgumentParser.parse_args()` parses this as the subcommand name, causing it to throw an error.
1 parent 2018346 commit a5f3a69
Copy full SHA for a5f3a69

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/semver/__main__.py

Copy file name to clipboardExpand all lines: src/semver/__main__.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def main(cliargs: Optional[List[str]] = None) -> int:
2525

2626

2727
if __name__ == "__main__":
28-
sys.exit(main(sys.argv))
28+
sys.exit(main(sys.argv[1:]))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.