Skip to content

Commit

Permalink
Fix overly verbose FieldSet in stack traces (#10978)
Browse files Browse the repository at this point in the history
Closes #10971.

[ci skip-rust]
  • Loading branch information
Eric-Arellano committed Oct 19, 2020
1 parent f6975ec commit 6e45e09
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/python/pants/engine/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,11 @@ def applicable_target_types(
def debug_hint(self) -> str:
return self.address.spec

def __repr__(self) -> str:
# We use a short repr() because this often shows up in stack traces. We don't need any of
# the field information because we can ask a user to send us their BUILD file.
return f"{self.__class__.__name__}(address={self.address})"


def _get_field_set_fields_from_target(
field_set: Type[_AbstractFieldSet], target: Target
Expand Down

0 comments on commit 6e45e09

Please sign in to comment.