donnemartin / gitsome

A supercharged Git/GitHub command line interface (CLI). An official integration for GitHub and GitHub Enterprise: https://github.com/works-with/category/desktop-tools
Other
7.59k stars 440 forks source link

Eliminate warning on Python 3.8 or later #206

Closed mkindahl closed 10 months ago

mkindahl commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

Closing as duplicate of #196 and #182