# HG changeset patch # User Mads Kiilerich # Date 2014-12-15 13:47:36 # Node ID ed4a3c0fe61a9bea4b07a152f7a7faa62876d2e9 # Parent 0e82346ae7ae6575ea065cfd3530b84c96e85649 files: remove redundant zip try/except diff --git a/kallithea/controllers/files.py b/kallithea/controllers/files.py --- a/kallithea/controllers/files.py +++ b/kallithea/controllers/files.py @@ -563,21 +563,16 @@ class FilesController(BaseRepoController 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')