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 SyntaxWarning: "is" and "is not" with a literal #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petersenna
Copy link

While adding support to a new modem I noticed the following warning:
/usr/local/lib/python3.10/site-packages/gsmmodem/modem.py:835: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if selected_phonebook is not "ON":
/usr/local/lib/python3.10/site-packages/gsmmodem/modem.py:841: SyntaxWarning: "is" with a literal. Did you mean "=="?
if response is "OK": # command is supported, but no number is set
/usr/local/lib/python3.10/site-packages/gsmmodem/modem.py:861: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if actual_phonebook is not "ON":

This patch makes the changes from "is not" to != and from "is" to "==".

Signed-off-by: Peter Senna Tschudin peter.senna@spearline.com

While adding support to a new modem I noticed the following warning:
   /usr/local/lib/python3.10/site-packages/gsmmodem/modem.py:835: SyntaxWarning: "is not" with a literal. Did you mean "!="?
     if selected_phonebook is not "ON":
   /usr/local/lib/python3.10/site-packages/gsmmodem/modem.py:841: SyntaxWarning: "is" with a literal. Did you mean "=="?
     if response is "OK": # command is supported, but no number is set
   /usr/local/lib/python3.10/site-packages/gsmmodem/modem.py:861: SyntaxWarning: "is not" with a literal. Did you mean "!="?
     if actual_phonebook is not "ON":

This patch makes the changes from "is not" to != and from "is" to "==".

Signed-off-by: Peter Senna Tschudin <peter.senna@spearline.com>
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

1 participant