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 Python 3.8 SyntaxWarning: "is not" with a literal #762

Conversation

gedakc
Copy link
Collaborator

@gedakc gedakc commented May 1, 2020

Recently some SyntaxWarning messages that arise from Python 3.8 were brought to light with issue #758.

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 "":

See also:

Issue34850 - Emit a syntax warning for "is" with a literal
https://bugs.python.org/issue34850

This PR is part of an ongoing effort to fix bugs in Manuskript.

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 olivierkes#758.

See also:

  Issue34850 - Emit a syntax warning for "is" with a literal
  https://bugs.python.org/issue34850
@TheJackiMonster
Copy link
Collaborator

I have searched and fixed the rest of them.

@TheJackiMonster TheJackiMonster merged commit de02b18 into olivierkes:develop Feb 21, 2021
@TheJackiMonster TheJackiMonster linked an issue Feb 21, 2021 that may be closed by this pull request
@TheJackiMonster TheJackiMonster added this to the 0.12.0 milestone Feb 22, 2021
@gedakc gedakc deleted the fix-python38-SyntaxWarning-is-not-with-a-literal branch May 28, 2021 19:14
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.

Python syntax warning upon installation
2 participants