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 Novus on Python 3.11 #62

Merged
merged 3 commits into from Nov 9, 2022
Merged

Fix Novus on Python 3.11 #62

merged 3 commits into from Nov 9, 2022

Conversation

shinrax2
Copy link
Contributor

@shinrax2 shinrax2 commented Nov 2, 2022

Summary

This PR fixes Novus running on Python 3.11.0 by making use of default_factory for fields inside of discord.ext.commands.flags.Flag.
I tested this PR on Python 3.8.10, 3.9.13, 3.10.7 & 3.11.0 with the reproduction code from #61 and my bot (which is quite basic) and had no errors.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@4Kaylum
Copy link
Member

4Kaylum commented Nov 9, 2022

I tested this PR on Python 3.8.10, 3.9.13, 3.10.7 & 3.11.0 with the reproduction code from #61 and my bot (which is quite basic) and had no errors.

Did you just see if the bot launched, or did you test the affected functionality?

The change you've made will set name, attribute, etc to MISSING() (ie _MissingSentinel()()). This is not a syntax error as it was before, but still not valid when called.

Your change should be field(default_factory=lambda: MISSING). Could you make that change?

Copy link
Contributor

@GlitchMasta47 GlitchMasta47 left a comment

Choose a reason for hiding this comment

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

These changes should be valid

discord/ext/commands/flags.py Outdated Show resolved Hide resolved
discord/ext/commands/flags.py Outdated Show resolved Hide resolved
4Kaylum and others added 2 commits November 9, 2022 07:57
Co-authored-by: GlitchMasta47 <17860556+GlitchMasta47@users.noreply.github.com>
Co-authored-by: GlitchMasta47 <17860556+GlitchMasta47@users.noreply.github.com>
@4Kaylum 4Kaylum merged commit 5e29ad3 into Voxel-Fox-Ltd:master Nov 9, 2022
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.

None yet

3 participants