Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix argument annotation in converter.parse() signature #1665

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

jacobtylerwalls
Copy link
Member

Fixes error reported in #1664 (comment).

Adds missing coverage.

@@ -1375,16 +1376,13 @@ def parse(value: bundles.MetadataEntry | bytes | str | pathlib.Path,
valueStr = ''

if (common.isListLike(value)
and isinstance(value, collections.abc.Sequence)
Copy link
Member Author

Choose a reason for hiding this comment

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

Redundant now that isListLike no longer permits sets

and len(value) == 2
and isinstance(value[1], int)
Copy link
Member Author

Choose a reason for hiding this comment

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

Was preventing the more informative error message below, allowing later elif blocks to match and crash.

@jacobtylerwalls jacobtylerwalls mentioned this pull request Nov 18, 2023
@coveralls
Copy link

Coverage Status

coverage: 93.051% (+0.009%) from 93.042%
when pulling 515e0e6 on fix-mypy-error
into a938a8c on master.

Comment on lines +2079 to +2080
with self.assertRaises(ConverterException):
parse((fp, 8))
Copy link
Member

Choose a reason for hiding this comment

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

wow... bug.

Copy link
Member

@mscuthbert mscuthbert left a comment

Choose a reason for hiding this comment

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

Thank you. Looks great.

@mscuthbert mscuthbert merged commit defd61e into master Jan 2, 2024
7 checks passed
@mscuthbert mscuthbert deleted the fix-mypy-error branch January 2, 2024 21:26
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.

3 participants