From d70bcf21496c4707562afaa45beed56d15f50c41 Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Wed, 13 Jun 2012 19:35:06 -0400 Subject: [PATCH] * In text_output methods, do the required action iff self.out is not None. --- iofmt/text_output.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iofmt/text_output.py b/iofmt/text_output.py index 831eced..9cd4c3a 100644 --- a/iofmt/text_output.py +++ b/iofmt/text_output.py @@ -164,11 +164,11 @@ class text_output(object): # self.out is yet another text_output instance. # But beware of possible method polymorphism if you do this. (!!!) def _write(self, s): - if self.out: self.out.write(s) + if self.out != None: self.out.write(s) def _flush(self): - if self.out: self.out.flush() + if self.out != None: self.out.flush() def _write_flush(self, s): - if self.out: + if self.out != None: self.out.write(s) self.out.flush() # The logger itself is a file-like object, too: