Skip to content

Commit

Permalink
Fix exception causes in config_scope.py (IDSIA#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-RR committed Jan 19, 2023
1 parent c839a41 commit 2eadffb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sacred/config/config_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ def get_function_body_code(func):
"('{}' in File \"{}\", line {})".format(
statement.strip(), filename, lineno
)
)
) from e
elif e.args[0] == "'yield' outside function":
filename, lineno, _, statement = e.args[1]
raise SyntaxError(
"No yield statements allowed in ConfigScopes\n"
"('{}' in File \"{}\", line {})".format(
statement.strip(), filename, lineno
)
)
) from e
else:
raise
return body_code
Expand Down

0 comments on commit 2eadffb

Please sign in to comment.