================
@@ -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
----------------
ilovepi wrote:

Is the `try/except` better than just letting the exception propagate up through 
main? I'm fine w/ it, but I wonder if `print` is better than the unhandled 
exception? it also doesn't fail, does it? So I don't think you'd return an 
error code if this didn't succeed, would you?

https://github.com/llvm/llvm-project/pull/105902
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to