[clang] [clang][test] Rewrote test to work with lit internal shell syntax (PR #105902)

Connie Zhu via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 12:07:17 PDT 2024


================
@@ -0,0 +1,22 @@
+import argparse
+import os
+
+def get_file_size(file_path):
+    try:
+        return os.path.getsize(file_path)
+    except:
+        print(f"Unable to get file size of {file_path}")
+        return None
----------------
connieyzhu wrote:

Now that I look at it again, I think having an unhandled exception would be better. I didn't realize that my implementation doesn't actually return an error code, but I would think having the error code would be better for debugging. 

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


More information about the cfe-commits mailing list