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

Fix Cheetah error #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix Cheetah error #44

wants to merge 1 commit into from

Conversation

uajqq
Copy link

@uajqq uajqq commented Dec 28, 2021

Fixes #30 and #40

@Valinwolf Valinwolf mentioned this pull request Jan 26, 2022
@kbahey
Copy link

kbahey commented Dec 24, 2024

Same issue on my server.

This PR needs to be merged into the repository.

@seehausen
Copy link

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

@kbahey
Copy link

kbahey commented Dec 24, 2024

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.

@seehausen
Copy link

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

@kbahey
Copy link

kbahey commented Dec 24, 2024

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.

@seehausen
Copy link

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

@kbahey
Copy link

kbahey commented Dec 24, 2024

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.

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.

wee_reports shows syntax warnings
3 participants