[issue36091] clean up async generator from types module

Henry Chen report at bugs.python.org
Sat Feb 23 01:07:17 EST 2019


New submission from Henry Chen <tahafut at gmail.com>:

the following script:
```
import sys, types

def tr(frame, event, arg):
    print(frame, event, arg)
    return tr

sys.settrace(tr)
```
gives the output:
```
<frame object at 0x106c5cd48> call None
<frame object at 0x106c5cd48> exception (<class 'GeneratorExit'>, GeneratorExit(), <traceback object at 0x106cc1f88>)
<frame object at 0x106c5cd48> return None
```

This is due to Lib/types.py creating an async generator for the sole purpose of getting its type. I'll remove that reference after use to prevent the above message, which is probably benign but perhaps unnerving.

----------
components: Library (Lib)
messages: 336368
nosy: scotchka
priority: normal
severity: normal
status: open
title: clean up async generator from types module
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36091>
_______________________________________


More information about the Python-bugs-list mailing list