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.
16 lines
397 B
Plaintext
16 lines
397 B
Plaintext
# UNSUPPORTED: system-windows
|
|
|
|
# RUN: rm -rf %t.stdout %t.stderr
|
|
# RUN: cat %s | %lldb --script-language python > %t.stdout 2> %t.stderr
|
|
# RUN: cat %t.stdout | FileCheck %s --check-prefix STDOUT
|
|
# RUN: cat %t.stderr | FileCheck %s --check-prefix STDERR
|
|
script
|
|
import sys
|
|
variable = 250 + 5
|
|
print(variable)
|
|
print("wrote to", "stderr", file=sys.stderr)
|
|
quit
|
|
|
|
# STDOUT: 255
|
|
# STDERR: wrote to stderr
|