mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix jinja2 template debug test after PY-18734
This commit is contained in:
@@ -379,7 +379,7 @@ def change_attr_expression(thread_id, frame_id, attr, expression, dbg, value=Non
|
||||
try:
|
||||
expression = expression.replace('@LINE@', '\n')
|
||||
|
||||
if dbg.plugin:
|
||||
if dbg.plugin and not value:
|
||||
result = dbg.plugin.change_variable(frame, attr, expression)
|
||||
if result:
|
||||
return result
|
||||
|
||||
@@ -136,12 +136,13 @@ class Jinja2TemplateFrame:
|
||||
|
||||
def _change_variable(self, frame, name, value):
|
||||
in_vars_or_parents = False
|
||||
if name in frame.f_locals['context'].parent:
|
||||
self.back_context.parent[name] = value
|
||||
in_vars_or_parents = True
|
||||
if name in frame.f_locals['context'].vars:
|
||||
self.back_context.vars[name] = value
|
||||
in_vars_or_parents = True
|
||||
if 'context' in frame.f_locals:
|
||||
if name in frame.f_locals['context'].parent:
|
||||
self.back_context.parent[name] = value
|
||||
in_vars_or_parents = True
|
||||
if name in frame.f_locals['context'].vars:
|
||||
self.back_context.vars[name] = value
|
||||
in_vars_or_parents = True
|
||||
|
||||
l_name = 'l_' + name
|
||||
if l_name in frame.f_locals:
|
||||
|
||||
Reference in New Issue
Block a user