Mercurial > ~astiob > upreckon > hgweb
diff 2.00/zipfile26.py @ 30:f17f19d9eb0a
hasattr -> try in the newly added 2.6 zipfile
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Wed, 24 Nov 2010 23:42:06 +0000 |
parents | a8cc383b787c |
children |
line wrap: on
line diff
--- a/2.00/zipfile26.py Wed Nov 24 23:21:31 2010 +0000 +++ b/2.00/zipfile26.py Wed Nov 24 23:42:06 2010 +0000 @@ -625,8 +625,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