##// END OF EJS Templates
sshrepo: move mkstemp() out of the try block, we don't use the exception...
Benoit Boissinot -
r9742:0c84afa1 default
parent child Browse files
Show More
@@ -181,11 +181,9 b' class sshserver(object):'
181 self.respond('')
181 self.respond('')
182
182
183 # write bundle data to temporary file because it can be big
183 # write bundle data to temporary file because it can be big
184 tempname = fp = None
185 try:
186 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
184 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-')
187 fp = os.fdopen(fd, 'wb+')
185 fp = os.fdopen(fd, 'wb+')
188
186 try:
189 count = int(self.fin.readline())
187 count = int(self.fin.readline())
190 while count:
188 while count:
191 fp.write(self.fin.read(count))
189 fp.write(self.fin.read(count))
@@ -212,9 +210,7 b' class sshserver(object):'
212 self.lock.release()
210 self.lock.release()
213 self.lock = None
211 self.lock = None
214 finally:
212 finally:
215 if fp is not None:
216 fp.close()
213 fp.close()
217 if tempname is not None:
218 os.unlink(tempname)
214 os.unlink(tempname)
219
215
220 def do_stream_out(self):
216 def do_stream_out(self):
General Comments 0
You need to be logged in to leave comments. Login now