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 internal error inheriting a dataclass duplicated field #7792 #7808

Merged
merged 1 commit into from Oct 29, 2019

Conversation

@vbarbaresi
Copy link
Contributor

vbarbaresi commented Oct 28, 2019

The error was:

    (attr,) = [a for a in all_attrs if a.name == name]
ValueError: not enough values to unpack (expected 1, got 0)
  • No need to enter in the else if all_attrs is empty

  • And don't assume that the matching attr exists in all_attr

The error was:
```
    (attr,) = [a for a in all_attrs if a.name == name]
ValueError: not enough values to unpack (expected 1, got 0)
```

No need to enter in the `else` if all_attrs is empty

And don't assume that there is a matching attr in all_attr
@JukkaL
JukkaL approved these changes Oct 29, 2019
Copy link
Collaborator

JukkaL left a comment

Thanks for the fix! Looks good. The first error message looks a bit odd but it's a much less serious issue than a crash.

@JukkaL JukkaL merged commit dc325e4 into python:master Oct 29, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vbarbaresi vbarbaresi deleted the vbarbaresi:fix_7792 branch Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.