Fix string equality checks (#267)

This commit is contained in:
ObserverOfTime 2019-12-30 14:56:27 +02:00 committed by Etoh
parent 8bd80d046a
commit bf5c8dd531
3 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ import syncplay
from syncplay.messages import getMissingStrings
missingStrings = getMissingStrings()
if missingStrings is not None and missingStrings is not "":
if missingStrings is not None and missingStrings != "":
import warnings
warnings.warn("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings))
@ -718,4 +718,4 @@ info = dict(
)
sys.argv.extend(['py2exe'])
setup(**info)
setup(**info)

View File

@ -135,7 +135,7 @@ class SyncplayClient(object):
if constants.DEBUG_MODE and constants.WARN_ABOUT_MISSING_STRINGS:
missingStrings = getMissingStrings()
if missingStrings is not None and missingStrings is not "":
if missingStrings is not None and missingStrings != "":
self.ui.showDebugMessage("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings))
def initProtocol(self, protocol):

View File

@ -320,7 +320,7 @@ class ConfigDialog(QtWidgets.QDialog):
try:
self.lastCheckedForUpdates = settings.value("lastCheckedQt", None)
if self.lastCheckedForUpdates:
if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] is not "":
if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] != "":
if self.lastCheckedForUpdates.toPython() > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"):
self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z")
else: