From 13452afe3fc5bd4ac7dc2f82c351247edb0d7901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Wed, 7 Nov 2012 18:36:26 +0100 Subject: [PATCH] m --- ponysay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ponysay.py b/ponysay.py index da671633..b28c6531 100755 --- a/ponysay.py +++ b/ponysay.py @@ -65,9 +65,10 @@ fd3 = None ''' def printinfo(text = '', end = '\n'): global fd3 - if os.path.exists('/proc/self/fd/3'): + if os.path.exists('/proc/self/fd/3') and os.path.isfile('/proc/self/fd/3'): if fd3 is None: fd3 = os.fdopen(3, 'w') + if fd3 is not None: fd3.write(str(text) + end)