summaryrefslogtreecommitdiff
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-29 22:33:36 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-29 22:33:36 +0300
commit3066fc41d1a054e7734e8334af9758173ee0aa9d (patch)
treea9fb498d0ede1cf885c2d20b5b7b4d072b5ce551 /Lib/traceback.py
parent525faaeffc557899b83463f3b1b74d2f39cc7e13 (diff)
downloadcpython-git-3066fc41d1a054e7734e8334af9758173ee0aa9d.tar.gz
Issue #25111: Fixed comparison of traceback.FrameSummary.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 112e9ba829..9b69da0e8a 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]