Error !

SyntaxException: (SystemError) AST constructor recursion depth mismatch (before=147, after=167) ("grade = 'Z'\nif weekly['STATUS'] == 'Wanted':\n ") in file '/app/mylar3/data/interfaces/default/weeklypull.html' at line: 109 char: 4

</thead> <tbody> %for weekly in weeklyresults: <% grade = 'Z' if weekly['STATUS'] == 'Wanted': grade = 'X' elif weekly['STATUS'] == 'Snatched': grade = 'C'
/lsiopy/lib/python3.11/site-packages/mako/pyparser.py, line 38:
raise exceptions.SyntaxException(
/lsiopy/lib/python3.11/site-packages/mako/ast.py, line 42:
expr = pyparser.parse(code.lstrip(), "exec", **exception_kwargs)
/lsiopy/lib/python3.11/site-packages/mako/parsetree.py, line 158:
self.code = ast.PythonCode(text, **self.exception_kwargs)
/lsiopy/lib/python3.11/site-packages/mako/lexer.py, line 129:
node = nodecls(*args, **kwargs)
/lsiopy/lib/python3.11/site-packages/mako/lexer.py, line 392:
self.append_node(
/lsiopy/lib/python3.11/site-packages/mako/lexer.py, line 248:
if self.match_python_block():
/lsiopy/lib/python3.11/site-packages/mako/template.py, line 657:
node = lexer.parse()
/lsiopy/lib/python3.11/site-packages/mako/template.py, line 677:
source, lexer = _compile(
/lsiopy/lib/python3.11/site-packages/mako/template.py, line 393:
code, module = _compile_text(self, data, filename)
/lsiopy/lib/python3.11/site-packages/mako/template.py, line 317:
module = self._compile_from_file(path, filename)
/lsiopy/lib/python3.11/site-packages/mako/lookup.py, line 313:
self._collection[uri] = template = Template(
/lsiopy/lib/python3.11/site-packages/mako/lookup.py, line 252:
return self._load(srcfile, uri)
/app/mylar3/mylar/webserve.py, line 129:
template = _hplookup.get_template(templatename)