function 'find_template_loader' doesn't work with PyPy 1.2
|Reported by:||avostryakov||Owned by:||nobody|
|Severity:||Keywords:||find template, pypy|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
I tested django template system under PyPy 1.2. Basically it works except one small line of code in function 'find_template_loader; (<root project's directory>/django/template/loader.py):
'if hasattr(loader, 'iter'):'
I suggest to replace this line with:
'if isinstance(loader, tuple):'
The patch is attached. I think it'll be better because a new code doesn't use a little tricky feature of python. Class 'string' doesn't have 'iter' attribute but can be iterated.
Change History (4)
Changed 4 years ago by avostryakov
comment:1 Changed 4 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted