[llvm] [llvm-lit] Fix `TypeError` string argument expected in lit's internal shell (PR #105925)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 01:30:36 PDT 2024
================
@@ -413,7 +413,7 @@ def maybeUnescape(arg):
for arg in args[:-1]:
stdout.write(encode(maybeUnescape(arg)))
stdout.write(encode(" "))
- stdout.write(encode(maybeUnescape(args[-1])))
+ stdout.write(encode(maybeUnescape(str(args[-1]))))
----------------
Harini0924 wrote:
@arichardson In this PR [Reapply "[llvm-lit] Add precommit test to verify current behavior of glob expansion in lit's internal shell" (#106763#) 107169](https://github.com/llvm/llvm-project/pull/107169/files), I have added the necessary tests to verify the current behavior. After analyzing the situation, I believe we should definitely expand `args[0]` within the `expand_glob_expressions` function itself, so we don't need to handle it separately later on.
By expanding `args[0]` directly in this function, we can avoid the need for special handling elsewhere in the code. Once this change is approved, I can go ahead and update `shtest-glob.py` to reflect the expected behavior by changing:
```
# CHECK: UNRESOLVED: shtest-glob :: glob-echo.txt ({{[^)]*}})
# CHECK: TypeError: string argument expected, got 'GlobItem'
```
to:
```
# CHECK: PASS: shtest-glob :: glob-echo.txt ({{[^)]*}})
```
Let me know if this approach looks good to you!
https://github.com/llvm/llvm-project/pull/105925
More information about the llvm-commits
mailing list