Signal whether the frame is a CPython or logging module internal.
(frame)
| 195 | # frames of the import mechanism are skipped when logging at module level and |
| 196 | # using a stacklevel value greater than one. |
| 197 | def _is_internal_frame(frame): |
| 198 | """Signal whether the frame is a CPython or logging module internal.""" |
| 199 | filename = os.path.normcase(frame.f_code.co_filename) |
| 200 | return filename == _srcfile or ( |
| 201 | "importlib" in filename and "_bootstrap" in filename |
| 202 | ) |
| 203 | |
| 204 | |
| 205 | def _checkLevel(level): |