-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the unexpected error that occurs when an empty control block is u…
…sed. Fixes: #146 When the first control block is empty or comment, the correct result will now be rendered. ```python from mako.template import Template template = r""" % if False: % elif False: % else: test % endif """ t = Template(template) print(t.render()) ``` Result: ``` test ``` Closes: #387 Pull-request: #387 Pull-request-sha: fb257ff Change-Id: Ief78cdf4eb39b6e8257332ed034dab052c715420
- Loading branch information
Showing
3 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. change:: | ||
:tags: bug, codegen | ||
:tickets: 146 | ||
|
||
Fixed unexpected error when use control lines which the | ||
first control block with no bodies other than comments, | ||
as `pass` is now added to the first empty block. | ||
Pull request courtesy Hai Zhu. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters