Skip to content

Commit

Permalink
Check if alternative exists / is necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrodehl committed Dec 21, 2022
1 parent 0fa66aa commit 119d784
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/miniflask/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def __init__(self, varid, mf, caller_traceback, cliargs=False, parsefn=False, is
if isinstance(node, ast.IfExp):
rvs = self._find_var_names(node.orelse, lcl_variables=self.local_arguments)
for lv in self._find_comp_names(node.test, self.local_arguments):
self.depends_alternatives[lv] = rvs
if len(rvs):
self.depends_alternatives[lv] = rvs

def str(self):
return str(self.varid)
Expand Down

0 comments on commit 119d784

Please sign in to comment.