Skip to content

Commit 150ffb6

Browse files
c-p-i-opytorchmergebot
authored andcommitted
[flight recorder] Updated MatchState to have a member variable (pytorch#141297)
Summary: Without this change calling `str(MatchState.SOMETHING)` will cause exception. Test Plan: Can we add unittest somewhere? Ensure `str(MatchState.FULLY_MATCHED)` and `str(MatchState.FULLY_MATCHED())` won't raise exception. Differential Revision: D66321609 Pull Request resolved: pytorch#141297 Approved by: https://github.com/fduwjj
1 parent 3bec67b commit 150ffb6

File tree

1 file changed

+1
-1
lines changed
  • tools/flight_recorder/components

1 file changed

+1
-1
lines changed

tools/flight_recorder/components/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __call__(self, culprit: Optional[str] = None) -> "MatchState":
7474
return self
7575

7676
def __str__(self) -> str:
77-
details = f", {self.culprit}" if self.culprit else ""
77+
details = f", {self.culprit}" if getattr(self, "culprit", None) else ""
7878
return f"Error type: {self.name}{details}"
7979

8080

0 commit comments

Comments
 (0)