From 0bcc75705a7f2e4824fe0e06086fba67f813130d Mon Sep 17 00:00:00 2001 From: mhagger Date: Sat, 28 Nov 2009 10:19:11 +0000 Subject: [PATCH] Record new chunks earlier to avoid special case in exception handler. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@4976 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/sort.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cvs2svn_lib/sort.py b/cvs2svn_lib/sort.py index 8a8911c1..6566bd23 100644 --- a/cvs2svn_lib/sort.py +++ b/cvs2svn_lib/sort.py @@ -90,10 +90,10 @@ def sort_file(input, output, key=None, buffer_size=32000, tempdirs=[]): ) os.close(fd) output_chunk = open(filename, 'w+b', 64*1024) + chunks.append(output_chunk) output_chunk.writelines(current_chunk) output_chunk.flush() output_chunk.seek(0) - chunks.append(output_chunk) except: for chunk in chunks: try: @@ -101,12 +101,6 @@ def sort_file(input, output, key=None, buffer_size=32000, tempdirs=[]): os.remove(chunk.name) except: pass - if output_chunk not in chunks: - try: - output_chunk.close() - os.remove(output_chunk.name) - except: - pass return finally: input_file.close() -- 2.11.4.GIT