Skip to content

Commit

Permalink
put the specific thing to fix at the top of the ast error message
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jan 5, 2019
1 parent 6ffbb3f commit b565291
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/python/pants/engine/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ def visit_Yield(self, node):
if not self._stmt_is_at_end_of_parent_list(expr_for_yield):
raise self.YieldVisitError(
self._generate_ast_error_message(node, """\
yield in @rule without assignment must come at the end of a series of statements.
A yield in an @rule without an assignment is equivalent to a return, and we
currently require that it comes at the end of a series of statements.
currently require that no statements follow such a yield at the same level of nesting.
Use `_ = yield Get(...)` if you wish to yield control to the engine and discard the result.
"""))

Expand Down

0 comments on commit b565291

Please sign in to comment.