[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
Tue Jul 7 03:15:54 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:

What's a "par"?

https://github.com/llvm/llvm-project/pull/206957


More information about the llvm-commits mailing list