[llvm] [lit] Don't crash in _write_message when getsourcefile() returns None (PR #206957)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 01:44:29 PDT 2026
================
@@ -222,7 +222,13 @@ def _write_message(self, kind, message):
f = inspect.currentframe()
# Step out of _write_message, and then out of wrapper.
f = f.f_back.f_back
- file = os.path.abspath(inspect.getsourcefile(f))
+ # getsourcefile() returns None when the calling frame's source is not on
+ # disk and not in linecache (e.g. lit packaged into a zip/par, or code
----------------
jh7370 wrote:
It doesn't look to be a widely known term. I tried searching for "par file" and various variations and I didn't get "python archive" once. The AI summary listed several other things that this could refer to. I'd avoid using the "par" term in the comments to avoid confusion.
https://github.com/llvm/llvm-project/pull/206957
More information about the llvm-commits
mailing list