summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io.c b/io.c
index a422cc0869..8dcf258af9 100644
--- a/io.c
+++ b/io.c
@@ -2156,7 +2156,9 @@ rb_f_p(argc, argv)
for (i=0; i<argc; i++) {
rb_p(argv[i]);
}
- rb_io_flush(rb_defout);
+ if (TYPE(rb_defout) != T_FILE) {
+ rb_io_flush(rb_defout);
+ }
return Qnil;
}