Commit 4735de5
committed
gh-136047 Allow typing._allow_reckless_class_checks to check
When `abc.py` fails to import `_abc` and instead imports `_py_abc.ABCMeta`,
`_py_abc.ABCMeta.__module__` is set to `abc` to allow
`typing._allow_reckless_class_checks` to work with it.
Unfortunately, when `typing._caller` falls back to using `sys._getframe`,
its `globals()` contains the real module name instead of the module name of the frame's function.
This patch allows checking for `_py_abc` in that scenario._py_abc
1 parent fb9f933 commit 4735de5
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1846 | 1852 | | |
1847 | | - | |
| 1853 | + | |
1848 | 1854 | | |
1849 | | - | |
1850 | | - | |
1851 | 1855 | | |
1852 | 1856 | | |
1853 | 1857 | | |
| |||
1860 | 1864 | | |
1861 | 1865 | | |
1862 | 1866 | | |
1863 | | - | |
| 1867 | + | |
1864 | 1868 | | |
1865 | 1869 | | |
1866 | 1870 | | |
| |||
0 commit comments