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

KeyError: 'elif' in ext/html #291

Open
wolfgang42 opened this issue Aug 15, 2021 · 0 comments
Open

KeyError: 'elif' in ext/html #291

wolfgang42 opened this issue Aug 15, 2021 · 0 comments

Comments

@wolfgang42
Copy link

wolfgang42 commented Aug 15, 2021

Traceback (most recent call last):
  [...]
  File "venv/lib/python3.8/site-packages/pyjade/compiler.py", line 129, in visitNode
    return getattr(self, 'visit%s' % name)(node, *args, **kwargs)
  File "venv/lib/python3.8/site-packages/pyjade/ext/html.py", line 108, in visitConditional
    self.visitConditional(item)
  File "venv/lib/python3.8/site-packages/pyjade/ext/html.py", line 104, in visitConditional
    if TYPE_CODE[conditional.type](value):
KeyError: 'elif'

Looks like the same sort of problem as #13.

Workaround:

# Bugfix for python-jade: pyjade/ext/html.py:TYPE_CODE has a typo and incorrectly declares 'elsif' instead of 'elif'
# https://github.com/syrusakbary/pyjade/issues/291
import pyjade, operator
pyjade.ext.html.TYPE_CODE['elif'] = operator.truth
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

No branches or pull requests

1 participant