aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-15 12:45:43 -0600
committerTom Tromey <tromey@adacore.com>2022-08-30 11:49:48 -0600
commit2d83dd693901cb2588517d7296f1360d902c89f7 (patch)
tree32108cbc3abf6acf574a5b79fb0686aa446d8fe7 /gdb/testsuite/gdb.python
parentdd083c6524f1e90dae19ed895b3f5eaf6228de68 (diff)
downloadgdb-2d83dd693901cb2588517d7296f1360d902c89f7.zip
gdb-2d83dd693901cb2588517d7296f1360d902c89f7.tar.gz
gdb-2d83dd693901cb2588517d7296f1360d902c89f7.tar.bz2
Fix flush for sys.stderr
GDB overwrites Python's sys.stdout and sys.stderr, but does not properly implement the 'flush' method -- it only ever will flush stdout. This patch fixes the bug. I couldn't find a straightforward way to write a test for this.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/python.exp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index 8c0da6d..48ff07e 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -297,8 +297,8 @@ with_test_prefix "test decode_line" {
}
# gdb.write
-gdb_test "python print (sys.stderr)" ".*gdb._GdbOutputErrorFile (instance|object) at.*" "test stderr location"
-gdb_test "python print (sys.stdout)" ".*gdb._GdbOutputFile (instance|object) at.*" "test stdout location"
+gdb_test "python print (sys.stderr)" ".*gdb._GdbFile (instance|object) at.*" "test stderr location"
+gdb_test "python print (sys.stdout)" ".*gdb._GdbFile (instance|object) at.*" "test stdout location"
gdb_test "python gdb.write(\"Foo\\n\")" "Foo" "test default write"
gdb_test "python gdb.write(\"Error stream\\n\", stream=gdb.STDERR)" "Error stream" "test stderr write"
gdb_test "python gdb.write(\"Normal stream\\n\", stream=gdb.STDOUT)" "Normal stream" "test stdout write"