##// END OF EJS Templates
sshserver: Don't try to close fp if mkstemp failed
Thomas Arendsen Hein -
r6678:1eba8e8f default
parent child Browse files
Show More
@@ -167,7 +167,7 b' class sshserver(object):'
167 self.respond('')
167 self.respond('')
168
168
169 # write bundle data to temporary file because it can be big
169 # write bundle data to temporary file because it can be big
170
170 tempname = fp = None
171 try:
171 try:
172 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
172 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
173 fp = os.fdopen(fd, 'wb+')
173 fp = os.fdopen(fd, 'wb+')
@@ -198,8 +198,10 b' class sshserver(object):'
198 self.lock.release()
198 self.lock.release()
199 self.lock = None
199 self.lock = None
200 finally:
200 finally:
201 fp.close()
201 if fp is not None:
202 os.unlink(tempname)
202 fp.close()
203 if tempname is not None:
204 os.unlink(tempname)
203
205
204 def do_stream_out(self):
206 def do_stream_out(self):
205 streamclone.stream_out(self.repo, self.fout)
207 streamclone.stream_out(self.repo, self.fout)
General Comments 0
You need to be logged in to leave comments. Login now