diff options
| author | Ebuka Ezike <yerimyah1@gmail.com> | 2026-01-26 22:20:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-26 22:20:55 +0000 |
| commit | 78f9d78b13423ecfc354579ef00599f68e0f5b88 (patch) | |
| tree | a735e0e2e4cab9b2663f71f0c056b8a9a7c88ec5 /lldb/test/Shell/ScriptInterpreter/Python | |
| parent | 460c9b2db144e4ef736a31f29c0b366e565f2574 (diff) | |
| download | llvm-78f9d78b13423ecfc354579ef00599f68e0f5b88.zip llvm-78f9d78b13423ecfc354579ef00599f68e0f5b88.tar.gz llvm-78f9d78b13423ecfc354579ef00599f68e0f5b88.tar.bz2 | |
[lldb] Fix Python stderr redirection in test (#177970)
Python's internal stderr may differ from sys.stderr.
When Python writes errors, it uses its internal stderr rather than the
overwritten sys.stderr.
This may not be the same file/handle
Fix the test to explicitly write to the specified stderr.
Diffstat (limited to 'lldb/test/Shell/ScriptInterpreter/Python')
| -rw-r--r-- | lldb/test/Shell/ScriptInterpreter/Python/io.test | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/io.test b/lldb/test/Shell/ScriptInterpreter/Python/io.test index 1a3ff8d..f4303d4 100644 --- a/lldb/test/Shell/ScriptInterpreter/Python/io.test +++ b/lldb/test/Shell/ScriptInterpreter/Python/io.test @@ -5,10 +5,11 @@ # RUN: cat %t.stdout | FileCheck %s --check-prefix STDOUT # RUN: cat %t.stderr | FileCheck %s --check-prefix STDERR script -variable = 300 +import sys +variable = 250 + 5 print(variable) -print(not_value) +print("wrote to", "stderr", file=sys.stderr) quit -# STDOUT: 300 -# STDERR: NameError{{.*}}is not defined +# STDOUT: 255 +# STDERR: wrote to stderr |
