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

Eliminate warning on Python 3.8 or later #206

Closed
wants to merge 1 commit into from

Conversation

mkindahl
Copy link

If is not or is is used to compare literals, Python will complain on 3.8 or later. Change this to use != and == instead.

If `is not` or `is` is used to compare literals, Python will complain
on 3.8 or later. Change this to use `!=` and `==` instead.
@mkindahl
Copy link
Author

It shows up this way on my machine:

mats@fury:~$ sudo apt install gitsome
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  gitsome
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 105 kB of archives.
After this operation, 691 kB of additional disk space will be used.
Get:1 http://se.archive.ubuntu.com/ubuntu jammy/universe amd64 gitsome all 0.8.0+ds-6ubuntu1 [105 kB]
Fetched 105 kB in 0s (814 kB/s)   
Selecting previously unselected package gitsome.
(Reading database ... 670661 files and directories currently installed.)
Preparing to unpack .../gitsome_0.8.0+ds-6ubuntu1_all.deb ...
Unpacking gitsome (0.8.0+ds-6ubuntu1) ...
Setting up gitsome (0.8.0+ds-6ubuntu1) ...
/usr/lib/python3/dist-packages/gitsome/github.py:792: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  ('/' + language if language is not 'overall' else '') +
/usr/lib/python3/dist-packages/gitsome/lib/html2text/html2text.py:95: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if c is not ' ' and c is not '  ':
/usr/lib/python3/dist-packages/gitsome/lib/html2text/html2text.py:95: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if c is not ' ' and c is not '  ':
/usr/lib/python3/dist-packages/gitsome/lib/html2text/html2text.py:96: SyntaxWarning: "is" with a literal. Did you mean "=="?
  return c is ' '

@mkindahl
Copy link
Author

Closing as duplicate of #196 and #182

@mkindahl mkindahl closed this Jan 22, 2024
@mkindahl mkindahl deleted the use-equality-check branch January 22, 2024 08:03
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