##// END OF EJS Templates
infinitepush: replace `NamedTemporaryFile` with `pycompat.namedtempfile`...
Connor Sheehan -
r45752:a52bf967 stable
parent child Browse files
Show More
@@ -20,8 +20,6 b' from mercurial.utils import ('
20 20 procutil,
21 21 )
22 22
23 NamedTemporaryFile = tempfile.NamedTemporaryFile
24
25 23
26 24 class BundleWriteException(Exception):
27 25 pass
@@ -142,7 +140,7 b' class externalbundlestore(abstractbundle'
142 140 # closing it
143 141 # TODO: rewrite without str.format() and replace NamedTemporaryFile()
144 142 # with pycompat.namedtempfile()
145 with NamedTemporaryFile() as temp:
143 with pycompat.namedtempfile() as temp:
146 144 temp.write(data)
147 145 temp.flush()
148 146 temp.seek(0)
@@ -168,9 +166,8 b' class externalbundlestore(abstractbundle'
168 166 def read(self, handle):
169 167 # Won't work on windows because you can't open file second time without
170 168 # closing it
171 # TODO: rewrite without str.format() and replace NamedTemporaryFile()
172 # with pycompat.namedtempfile()
173 with NamedTemporaryFile() as temp:
169 # TODO: rewrite without str.format()
170 with pycompat.namedtempfile() as temp:
174 171 formatted_args = [
175 172 arg.format(filename=temp.name, handle=handle)
176 173 for arg in self.get_args
General Comments 0
You need to be logged in to leave comments. Login now