Skip to content

fix: warning about __main__ already being imported#884

Merged
henryiii merged 1 commit intowntrblm:mainfrom
henryiii:henryiii/fix/mainwarning
Nov 5, 2024
Merged

fix: warning about __main__ already being imported#884
henryiii merged 1 commit intowntrblm:mainfrom
henryiii:henryiii/fix/mainwarning

Conversation

@henryiii
Copy link
Copy Markdown
Collaborator

@henryiii henryiii commented Nov 5, 2024

Follow up to #878, fixing a warning about __main__ already being imported when running __main__ (I think it messes with the if __name__ == "__main__" statement when you use python -m nox and that imports __init__ and that triggers the __main__ import early).

Fixed by moving __main__.py contents to _cli.py then importing from there for __init__.py and __main__.py. Backward compatible.

Noticed in #881.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii force-pushed the henryiii/fix/mainwarning branch from 446b310 to 8fa3251 Compare November 5, 2024 04:29
@henryiii henryiii mentioned this pull request Nov 5, 2024
@henryiii henryiii merged commit f4a91df into wntrblm:main Nov 5, 2024
@henryiii henryiii deleted the henryiii/fix/mainwarning branch November 5, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants