[llvm] [lit] Add readfile substitution (PR #158441)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 18 22:13:26 PDT 2025
================
@@ -729,8 +729,11 @@ def _replaceReadFile(match):
filePath = match.group(1)
if not os.path.isabs(filePath):
filePath = os.path.join(cwd, filePath)
- with open(filePath) as fileHandle:
- return fileHandle.read()
+ try:
+ with open(filePath) as fileHandle:
+ return fileHandle.read()
+ except FileNotFoundError:
+ raise InternalShellError(cmd, "File does not exist: %s" % filePath)
----------------
boomanaiden154 wrote:
Added a mention of readfile.
https://github.com/llvm/llvm-project/pull/158441
More information about the llvm-commits
mailing list