Skip to content

Commit

Permalink
Merge pull request #27 from cjwatson/traceback-reference-cycle
Browse files Browse the repository at this point in the history
Avoid traceback reference cycle in PageTemplate._cook
  • Loading branch information
cjwatson committed May 15, 2021
2 parents 6f01c12 + 034f713 commit 7153aa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
4.6.0 (unreleased)
==================

- Nothing changed yet.
- Avoid traceback reference cycle in ``PageTemplate._cook``.


4.5.0 (2020-02-10)
Expand Down
11 changes: 7 additions & 4 deletions src/zope/pagetemplate/pagetemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,13 @@ def _cook(self):
source_file, self._text, pt_engine, self.content_type)
except:
etype, e = sys.exc_info()[:2]
self._v_errors = [
"Compilation failed",
"%s.%s: %s" % (etype.__module__, etype.__name__, e)
]
try:
self._v_errors = [
"Compilation failed",
"%s.%s: %s" % (etype.__module__, etype.__name__, e)
]
finally:
del e

self._v_cooked = 1

Expand Down

0 comments on commit 7153aa0

Please sign in to comment.