Pweave icon indicating copy to clipboard operation
Pweave copied to clipboard

Syntax warning from __init__.py: assert file != "" is not None

Open juliangilbey opened this issue 3 years ago • 0 comments

https://github.com/mpastell/Pweave/blob/45b56ec60c5badb4e40796178397a4eae5bdddcb/pweave/init.py#L47 raises the followng warning:

SyntaxWarning: "is not" with a literal. Did you mean "!="?
  assert file != "" is not None, "No input specified"

The code as written means: assert (file != "") and ("" is not None), which is clearly not what is wanted; perhaps it should be assert (file != "") and (file is not None) instead?

juliangilbey avatar May 31 '22 15:05 juliangilbey