New submission from jack1142 <[email protected]>:
Example code:
```
code = """
import typing
T = typing.TypeVar("T")
"""
exec(code, {})
```
Traceback:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 3, in <module>
File "C:\Python38\lib\typing.py", line 603, in __init__
def_mod = sys._getframe(1).f_globals['__name__'] # for pickling
KeyError: '__name__'
```
If this problem with `__name__` is not something that needs to be fixed, then I
also noticed that the same line in typing.py will also raise when platform
doesn't have `sys._getframe()`
----------
components: Library (Lib)
messages: 363990
nosy: jack1142
priority: normal
severity: normal
status: open
title: Making instance of `TypeVar` fails because of missing `__name__`
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39942>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com