bpo-44632: Fix support of TypeVar in the union type (GH-27139)

int | TypeVar('T') returns now an instance of types.Union
instead of typing.Union.
This commit is contained in:
Serhiy Storchaka 2021-07-14 20:09:15 +03:00 committed by GitHub
parent b81cac0560
commit a158b20019
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -127,7 +127,7 @@ is_typing_name(PyObject *obj, char *name)
if (strcmp(type->tp_name, name) != 0) {
return 0;
}
return is_typing_module(obj);
return is_typing_module((PyObject *)type);
}
static PyObject *