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

[V3] supress pynacl warning #1508

Merged
merged 10 commits into from
Apr 16, 2018
Merged

[V3] supress pynacl warning #1508

merged 10 commits into from
Apr 16, 2018

Conversation

mikeshardmind
Copy link
Contributor

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Supresses an irrelevant warning about a lack of pynacl from discord.py

@mikeshardmind mikeshardmind changed the title supress pynacl warning [V3] supress pynacl warning Apr 7, 2018
@tekulvw
Copy link
Member

tekulvw commented Apr 9, 2018

This is likely a better fit for redbot/__init__.py

@palmtree5 palmtree5 added the V3 label Apr 11, 2018
Copy link
Member

@palmtree5 palmtree5 left a comment

Choose a reason for hiding this comment

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

I'm still seeing the message
PyNaCl is not installed, voice will NOT be supported
on startup when running this branch

This reverts commit ee7ba9c.

Doesn't properly work here
@palmtree5 palmtree5 dismissed their stale review April 12, 2018 00:19

Works fine after reverting the move to init.py

Needs a module level import in __main__.py or the console scripts generated by pip setup don't ever run the code in __init__
@mikeshardmind
Copy link
Contributor Author

We didn't have a module import in __main__.py which meant the version checking didn't happen in there either when started from one of the console scripts. Changes are back in __init__.py as requested, with a module import added to __main__.py

@mikeshardmind
Copy link
Contributor Author

I've put the changes back in bot.py

Reasoning:
It may appear to be a global flag, but it isn't used as one (and doesn't make sense to be used as one), discord.py sets this to false immediately after warning if it is True. This shouldn't ever be expected by anything to be True past the creation of the client.

This also avoids the behavior of a duplicate import warning when the bot is launched using python -m redbot

@palmtree5 palmtree5 merged commit 96791bd into Cog-Creators:V3/develop Apr 16, 2018
@mikeshardmind mikeshardmind deleted the supresspynacl branch December 26, 2019 16:57
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