(index: int = 0)
| 5 | |
| 6 | |
| 7 | def f_module_name(index: int = 0) -> str: |
| 8 | frame = f_back(index + 1) |
| 9 | if frame is None: |
| 10 | return "" # nocov |
| 11 | name = frame.f_globals.get("__name__", "") |
| 12 | if not isinstance(name, str): |
| 13 | raise TypeError("Expected module name to be a string") # nocov |
| 14 | return name |
| 15 | |
| 16 | |
| 17 | def f_back(index: int = 0) -> FrameType | None: |
no test coverage detected