Fix Cheetah error
Fixes #30 and #40
Same issue on my server.
This PR needs to be merged into the repository.
I'm not sure about your changes see https://discuss.python.org/t/why-is-it-better-to-write-if-a-is-none-instead-of-if-a-none/42203 is not None should be better than != None
This repo is not maintained anymore... I added latest changes and PR to this fork https://github.com/seehase/neowx-material
The issue is not about
is not None
Rather it is about:
is not
And should be replaced with:
!=
The exact error message is:
SyntaxWarning: "is not" with 'str' literal. Did you mean "!="
Replacing all the 'is not' with '!=' solves the issue.
but all your changed files replaces
is not None
with
!= None
or do I get it wrong, and in this case is not None would be correct
My guess is that you are right. But the Cheetah Engine may be doing things differently or imposing a more strict syntax.
I ended up doing a global search and replace on all the *.tmpl files, and the warning went away.
OK, i don't cheetah very well, but I cannot see the errors you have
could it be maybe a wrong version
I have CHEETAH 3.2.6 and using the is not None in my templates
My version of Cheetah is newer. It is 3.3.3, from the Ubuntu 24.04 LTS repositories.
And my python is 3.12.3.