-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Since at least Python 3.12 (and earlier, it looks: python/cpython#103493), the pattern index is not "" emits aSyntaxWarning or SyntaxError when the interpreter compiles the remote.py file to bytecode.
This can be reproduced easily by creating a fresh virtual environment and running:
$ python -m cenpy.remote
/Users/<username>/cenpy/cenpy/remote.py:224: SyntaxWarning: "is not" with 'str' literal. Did you mean "!="?
if index is not "":
This SyntaxWarning only happens upon compilation, so it's not normally a big deal. But for some reason, especially when running in a fresh environment in CI, this triggers a SyntaxError when running within pytest. I haven't been able to reproduce the SyntaxError in my local environment, curiously enough, but the fix should be the same either way.
This should be easy to resolve by changing is not to !=.
Metadata
Metadata
Assignees
Labels
No labels