mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #25111: Fixed comparison of traceback.FrameSummary.
This commit is contained in:
commit
87b93fe36f
3 changed files with 21 additions and 9 deletions
|
@ -257,10 +257,14 @@ class FrameSummary:
|
|||
dict((k, repr(v)) for k, v in locals.items()) if locals else None
|
||||
|
||||
def __eq__(self, other):
|
||||
return (self.filename == other.filename and
|
||||
self.lineno == other.lineno and
|
||||
self.name == other.name and
|
||||
self.locals == other.locals)
|
||||
if isinstance(other, FrameSummary):
|
||||
return (self.filename == other.filename and
|
||||
self.lineno == other.lineno and
|
||||
self.name == other.name and
|
||||
self.locals == other.locals)
|
||||
if isinstance(other, tuple):
|
||||
return (self.filename, self.lineno, self.name, self.line) == other
|
||||
return NotImplemented
|
||||
|
||||
def __getitem__(self, pos):
|
||||
return (self.filename, self.lineno, self.name, self.line)[pos]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue