Message250693
Since 3.5 traceback.extract_tb() and traceback.extract_stack() return a list (actually list's subclass StackSummary) of FrameSummary objects instead of a list of tuples. FrameSummary is not fully compatible with tuple. One important incompatibility is in the comparing.
>>> import traceback
>>> traceback.extract_stack()[0] == ('<stdin>', 1, '<module>', '')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython-3.5/Lib/traceback.py", line 254, in __eq__
return (self.filename == other.filename and
AttributeError: 'tuple' object has no attribute 'filename'
In general __eq__ shouldn't raise an exception. Issue25108 is needed to be fixed first for tests.
Here is a patch that restores compatibility.
An alternative solution would be to make FrameSummary a subclass of tuple (namedtuple). |
|
Date |
User |
Action |
Args |
2015-09-14 17:48:43 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rbcollins |
2015-09-14 17:48:43 | serhiy.storchaka | set | messageid: <1442252923.78.0.0672158797601.issue25111@psf.upfronthosting.co.za> |
2015-09-14 17:48:43 | serhiy.storchaka | link | issue25111 messages |
2015-09-14 17:48:43 | serhiy.storchaka | create | |
|