Return the frame object for the caller's stack frame.
()
| 167 | currentframe = lambda: sys._getframe(1) |
| 168 | else: #pragma: no cover |
| 169 | def currentframe(): |
| 170 | """Return the frame object for the caller's stack frame.""" |
| 171 | try: |
| 172 | raise Exception |
| 173 | except Exception as exc: |
| 174 | return exc.__traceback__.tb_frame.f_back |
| 175 | |
| 176 | # |
| 177 | # _srcfile is used when walking the stack to check when we've got the first |