mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-01 18:49:38 +12:00
Fix Python 3.8 SyntaxWarning: "is not" with a literal
Fix these three warning messages from Python 3.8: /usr/share/manuskript/manuskript/main.py:104: SyntaxWarning: "is not" with a literal. Did you mean "!="? if platform.system() is not 'Windows': /usr/share/manuskript/manuskript/importer/opmlImporter.py:124: SyntaxWarning: "is" with a literal. Did you mean "=="? return len(s) is 0 /usr/share/manuskript/manuskript/exporter/pandoc/abstractPlainText.py:78: SyntaxWarning: "is" with a literal. Did you mean "=="? if self.formats is "": These SyntaxWarning messages were brought to light with Manuskript issue #758. See also: Issue34850 - Emit a syntax warning for "is" with a literal https://bugs.python.org/issue34850
This commit is contained in:
parent
917f1a2f73
commit
cd950cbe2a
|
@ -75,7 +75,7 @@ class pandocSetting:
|
|||
"""Return whether the specific setting is active with the given format."""
|
||||
|
||||
# Empty formats means all
|
||||
if self.formats is "":
|
||||
if self.formats == "":
|
||||
return True
|
||||
|
||||
# "html" in "html markdown latex"
|
||||
|
|
|
@ -121,4 +121,4 @@ class opmlImporter(abstractImporter):
|
|||
s = cls.restoreNewLines(inString)
|
||||
s = ''.join(s.split())
|
||||
|
||||
return len(s) is 0
|
||||
return len(s) == 0
|
||||
|
|
|
@ -101,7 +101,7 @@ def prepare(tests=False):
|
|||
|
||||
def respectSystemDarkThemeSetting():
|
||||
"""Adjusts the Qt theme to match the OS 'dark theme' setting configured by the user."""
|
||||
if platform.system() is not 'Windows':
|
||||
if platform.system() != 'Windows':
|
||||
return
|
||||
|
||||
# Basic Windows 10 Dark Theme support.
|
||||
|
|
Loading…
Reference in a new issue