changeset 28:3d535503161f

hasattr -> try
author Oleg Oshmyan <chortos@inbox.lv>
date Wed, 24 Nov 2010 01:42:39 +0000
parents dc4be35d17e0
children a8cc383b787c
files 2.00/zipfile3.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/2.00/zipfile3.py	Fri Oct 15 22:17:31 2010 +0000
+++ b/2.00/zipfile3.py	Wed Nov 24 01:42:39 2010 +0000
@@ -634,8 +634,10 @@
                         # we're out of raw bytes (both from the file and
                         # the local buffer); flush just to make sure the
                         # decompressor is done
-                        if hasattr(self.dc, 'flush'):
+                        try:
                             newdata += self.dc.flush()
+                        except AttributeError:
+                            pass
                         # prevent decompressor from being used again
                         self.dc = None