diff options
| author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2008-09-04 07:31:21 (GMT) |
|---|---|---|
| committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2008-09-04 07:31:21 (GMT) |
| commit | 65d66e100649e28637616d34a54ba528fe1a4100 (patch) | |
| tree | 6efdae571f881c03dc9bf8959acafb6971d0fad4 /Lib/logging | |
| parent | a0b7444f68ae5478f5553dcddea7ff44f283b25b (diff) | |
| download | cpython-65d66e100649e28637616d34a54ba528fe1a4100.zip cpython-65d66e100649e28637616d34a54ba528fe1a4100.tar.gz cpython-65d66e100649e28637616d34a54ba528fe1a4100.tar.bz2 | |
Issue #3772: Fixed regression problem in StreamHandler.emit().
Diffstat (limited to 'Lib/logging')
| -rw-r--r-- | Lib/logging/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 9026ef3..7b790d2 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -757,7 +757,7 @@ class StreamHandler(Handler): self.stream.write(fs % msg) else: try: - if hasattr(self.stream, 'encoding'): + if getattr(self.stream, 'encoding', None) is not None: self.stream.write(fs % msg.encode(self.stream.encoding)) else: self.stream.write(fs % msg) |
