Skip to content

Commit

Permalink
Merge pull request #4 from zopefoundation/issue2
Browse files Browse the repository at this point in the history
Do not pass `None` as a filename to chameleon
  • Loading branch information
jamadden committed Oct 17, 2017
2 parents 3fa64d9 + 676adb5 commit 68aaf86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions CHANGES.txt
@@ -1,10 +1,11 @@
Changelog
=========

2.1 (unreleased)
----------------
2.1.0 (unreleased)
------------------

- Nothing changed yet.
- Fix rendering with Chameleon 3.0 and above. See `issue 2
<https://github.com/zopefoundation/z3c.ptcompat/issues/2>`_.


2.0 (2016-09-02)
Expand Down
4 changes: 3 additions & 1 deletion src/z3c/ptcompat/engine.py
Expand Up @@ -48,8 +48,10 @@ def __call__(self, context, macros, tal=True, **options):

@classmethod
def cook(cls, source_file, text, engine, content_type):
# Chameleon doesn't like to have a 'filename' of None;
# see https://github.com/zopefoundation/z3c.ptcompat/issues/2
template = ChameleonPageTemplate(
text, filename=source_file, keep_body=True,
text, filename=source_file or '<string>', keep_body=True,
)

return cls(template), template.macros

0 comments on commit 68aaf86

Please sign in to comment.