afewmail / afew

an initial tagging script for notmuch mail
ISC License
325 stars 98 forks source link

SyntaxWarning: "is not" with a literal. Did you mean "!="? #298

Closed vikasrawal closed 4 years ago

vikasrawal commented 4 years ago

Why am I get this on a debian box?

/usr/lib/python3/dist-packages/afew/filters/init.py:15: SyntaxWarning: "is not" with a literal. Did you mean "!="? if filename is not 'init.py')

I have no problem on another machine that runs arch.

Is python2.7 coming in the way somehow? The file referred to here has:

__all__ = list(filename[:-3]
               for filename in glob.glob1(os.path.dirname(__file__),
                                          # py2.7 compat hack
                                          b'*.py' if sys.version_info[0] == 2 els
e '*.py')
               if filename is not '__init__.py')

Thanks for help.

Vikas

GuillaumeSeren commented 4 years ago

Hello, can you give us more context ? (Python version, Debian, etc)

ff2000 commented 4 years ago

Seems this was introduced in python3.8. Did a quick google search which returned this: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/ According to that it is a bug that needs to be fixed.

GuillaumeSeren commented 4 years ago

Fixed by #255 https://github.com/afewmail/afew/pull/255/files#diff-7eee8f8bbd720b02f8d8e7b9c5300f32R9