[pypy-commit] pypy py3.5: create temp files in udir not base dir

mattip pypy.commits at gmail.com
Wed Aug 22 00:29:33 EDT 2018


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.5
Changeset: r95015:e2d4a1e18fbf
Date: 2018-08-21 21:04 +0300
http://bitbucket.org/pypy/pypy/changeset/e2d4a1e18fbf/

Log:	create temp files in udir not base dir

diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py
--- a/pypy/module/imp/test/test_app.py
+++ b/pypy/module/imp/test/test_app.py
@@ -20,21 +20,23 @@
         cls.w_udir = cls.space.wrap(str(udir))
 
     def w__py_file(self):
-        f = open('@TEST.py', 'w')
+        fname = self.udir + '/@TEST.py'
+        f = open(fname, 'w')
         f.write('MARKER = 42\n')
         f.close()
-        return '@TEST.py'
+        return fname
 
     def w__pyc_file(self):
         import marshal, imp
         co = compile("marker=42", "x.py", "exec")
-        f = open('@TEST.pyc', 'wb')
+        fname = self.udir + '/@TEST.pyc'
+        f = open(fname, 'wb')
         f.write(imp.get_magic())
         f.write(b'\x00\x00\x00\x00')
         f.write(b'\x00\x00\x00\x00')
         marshal.dump(co, f)
         f.close()
-        return '@TEST.pyc'
+        return fname
 
     def test_find_module(self):
         import os, imp


More information about the pypy-commit mailing list