(depth=1, default='__main__')
| 1892 | |
| 1893 | |
| 1894 | def _caller(depth=1, default='__main__'): |
| 1895 | try: |
| 1896 | return sys._getframemodulename(depth + 1) or default |
| 1897 | except AttributeError: # For platforms without _getframemodulename() |
| 1898 | pass |
| 1899 | try: |
| 1900 | return sys._getframe(depth + 1).f_globals.get('__name__', default) |
| 1901 | except (AttributeError, ValueError): # For platforms without _getframe() |
| 1902 | pass |
| 1903 | return None |
| 1904 | |
| 1905 | def _allow_reckless_class_checks(depth=2): |
| 1906 | """Allow instance and class checks for special stdlib modules. |
no test coverage detected