From 5430b432e6a40c45b790afb2e21668d8164342a6 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 22 Jun 1998 15:46:26 +0000 Subject: Bugfix to ESR's code reported by himself: should use hasattr() to test for presence unread, not getattr()! --- Lib/rfc822.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 87d7d39..fc244c5 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -160,7 +160,7 @@ class Message: else: self.status = 'Non-header line where header expected' # Try to undo the read. - if getattr(self.fp, 'unread'): + if hasattr(self.fp, 'unread'): self.fp.unread(line) elif self.seekable: self.fp.seek(-len(line), 1) -- cgit v0.12