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

Warnings raised with Python 3.10 #113

Closed
EmilyBourne opened this issue Jul 3, 2023 · 2 comments · Fixed by #115
Closed

Warnings raised with Python 3.10 #113

EmilyBourne opened this issue Jul 3, 2023 · 2 comments · Fixed by #115
Labels
bug Something isn't working

Comments

@EmilyBourne
Copy link

Python 3.10 raises the following warnings:

/home/emily/Code/loki/scripts/loki_transform.py:166: SyntaxWarning: "is" with a literal. Did you mean "=="?
  directive = None if directive is 'none' else directive.lower()
/home/emily/Code/loki/scripts/loki_transform.py:450: SyntaxWarning: "is" with a literal. Did you mean "=="?
  directive = None if directive is 'none' else directive.lower()

As described here equal literals are not guaranteed to be the same object so this if evaluation may occasionally give wrong results on some systems

@EmilyBourne
Copy link
Author

I have not tested but as per Python's changelog this warning should appear in all active Python versions (3.8 onwards, 3.7 recently reached end of life)

@reuterbal
Copy link
Collaborator

Thanks for pointing this out. This is a bug in loki_transform.py that I had indeed fixed on a branch but apparently never contributed back.

@reuterbal reuterbal added the bug Something isn't working label Jul 5, 2023
@reuterbal reuterbal linked a pull request Jul 5, 2023 that will close this issue
mlange05 added a commit that referenced this issue Jul 5, 2023
…n-310

Fix directive comparison to literal (fix #113)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants