Skip to content

Conversation

@zooba
Copy link
Member

@zooba zooba commented May 8, 2025

Fixes #74

key, value, *opts = cmd_args[set_next]
except LookupError:
raise ArgumentError(f"Unexpected argument: {a}")
except KeyError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to raise IndexError (or LookupError directly) here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An unpacking error will raise IndexError, which should never happen, so it should bubble out as an internal error rather than unexpected argument.

@zooba zooba merged commit 9c81127 into python:main May 8, 2025
4 checks passed
@zooba zooba deleted the gh-74 branch May 8, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve failure message for py --list --online

2 participants