babca / python-gsmmodem

Maintained fork of a Python module to control GSM modems attached to the system: send/receive SMS messages in your scripts, handle calls, and more.
GNU Lesser General Public License v3.0
174 stars 106 forks source link

Fix SyntaxWarning: "is" and "is not" with a literal #110

Open petersenna opened 1 year ago

petersenna commented 1 year ago

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