diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-29 19:34:16 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-29 19:34:16 (GMT) |
commit | 87b93fe36f3d66bb200c8c0227a4cc7d50ff32d9 (patch) | |
tree | d2ed754421a87d5dcf00d02854868e68d095845f /Lib/traceback.py | |
parent | 11c715f12e9c089f79224d78db59b4907c7d7236 (diff) | |
parent | 3066fc41d1a054e7734e8334af9758173ee0aa9d (diff) | |
download | cpython-87b93fe36f3d66bb200c8c0227a4cc7d50ff32d9.zip cpython-87b93fe36f3d66bb200c8c0227a4cc7d50ff32d9.tar.gz cpython-87b93fe36f3d66bb200c8c0227a4cc7d50ff32d9.tar.bz2 |
Issue #25111: Fixed comparison of traceback.FrameSummary.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 682d8b1..1bac6eb 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -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] |