]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
close temp file 333/head
authorWing <SteelyWing@users.noreply.github.com>
Sat, 17 May 2014 05:18:39 +0000 (13:18 +0800)
committerWing <SteelyWing@users.noreply.github.com>
Sat, 17 May 2014 05:18:39 +0000 (13:18 +0800)
The test can't remove the temp file on Windows, because `mkstemp()` will open the temp.

jinja2/testsuite/loader.py

index a7350aab9fbe4b33c1c922ee21fbf46c019c545f..73a7f3005966010d06a4e6ca5e8b3a044ccac419 100644 (file)
@@ -115,7 +115,8 @@ class ModuleLoaderTestCase(JinjaTestCase):
         log = []
         self.reg_env = Environment(loader=prefix_loader)
         if zip is not None:
-            self.archive = tempfile.mkstemp(suffix='.zip')[1]
+            fd, self.archive = tempfile.mkstemp(suffix='.zip')
+            os.close(fd)
         else:
             self.archive = tempfile.mkdtemp()
         self.reg_env.compile_templates(self.archive, zip=zip,