changeset 4689:ed4a3c0fe61a

files: remove redundant zip try/except
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Dec 2014 13:47:36 +0100
parents 0e82346ae7ae
children 960248c6e021
files kallithea/controllers/files.py
diffstat 1 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/files.py	Thu Nov 27 14:28:59 2014 +0000
+++ b/kallithea/controllers/files.py	Mon Dec 15 13:47:36 2014 +0100
@@ -563,21 +563,16 @@
 
         if not use_cached_archive:
             # generate new archive
-            temp_stream = None
-            try:
-                fd, archive = tempfile.mkstemp()
-                temp_stream = open(archive, 'wb')
-                log.debug('Creating new temp archive in %s' % archive)
-                cs.fill_archive(stream=temp_stream, kind=fileformat, subrepos=subrepos)
-                temp_stream.close()
-                if not subrepos and archive_cache_enabled:
-                    #if we generated the archive and use cache rename that
-                    log.debug('Storing new archive in %s' % cached_archive_path)
-                    shutil.move(archive, cached_archive_path)
-                    archive = cached_archive_path
-            finally:
-                if temp_stream:
-                    temp_stream.close()
+            fd, archive = tempfile.mkstemp()
+            temp_stream = open(archive, 'wb')
+            log.debug('Creating new temp archive in %s' % archive)
+            cs.fill_archive(stream=temp_stream, kind=fileformat, subrepos=subrepos)
+            temp_stream.close()
+            if not subrepos and archive_cache_enabled:
+                #if we generated the archive and use cache rename that
+                log.debug('Storing new archive in %s' % cached_archive_path)
+                shutil.move(archive, cached_archive_path)
+                archive = cached_archive_path
 
         def get_chunked_archive(archive):
             stream = open(archive, 'rb')