Skip to content

Commit

Permalink
Fix handling translator stack when exception is occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Jun 1, 2020
1 parent 2f635b6 commit 09ed56f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pony/orm/sqltranslation.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,9 @@ def __init__(translator, tree, parent_translator, code_key=None, filter_num=None
try:
translator.init(tree, parent_translator, code_key, filter_num, extractors, vars, vartypes, left_join, optimize)
except UseAnotherTranslator as e:
assert local.translators
t = local.translators.pop()
assert t is e.translator
translator = e.translator
raise
else:
finally:
assert local.translators
t = local.translators.pop()
assert t is translator
Expand Down

0 comments on commit 09ed56f

Please sign in to comment.