Message300911
Code to reproduce:
def import_in_finally_fail():
try:
print('yo')
finally:
import asyncio.queues as aq
Results in:
In [68]: import_in_finally_fail()
yo
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
<ipython-input-68-4a6d2efcb22b> in <module>()
----> 1 import_in_finally_fail()
/tmp/py2661VBj in import_in_finally_fail()
SystemError: 'finally' pops bad exception
The exact import does matter, but it needs to be at least 2 modules deep and be aliased.
By patching cpython to put what finally pops off the stack in the error message it looks like it is the parent module of the import.
This was found via the Matplotlib test suite (ex https://travis-ci.org/matplotlib/matplotlib/jobs/262907186 ) and reported to pytest (https://github.com/pytest-dev/pytest/issues/2674) |
|
Date |
User |
Action |
Args |
2017-08-27 02:38:09 | tcaswell | set | recipients:
+ tcaswell |
2017-08-27 02:38:08 | tcaswell | set | messageid: <1503801488.97.0.284675687907.issue31286@psf.upfronthosting.co.za> |
2017-08-27 02:38:08 | tcaswell | link | issue31286 messages |
2017-08-27 02:38:07 | tcaswell | create | |
|