[pypy-svn] r37869 - pypy/dist/pypy/lang/js
santagada at codespeak.net
santagada at codespeak.net
Sat Feb 3 14:35:16 CET 2007
Author: santagada
Date: Sat Feb 3 14:35:13 2007
New Revision: 37869
Modified:
pypy/dist/pypy/lang/js/jsparser.py
Log:
fixed the temp file problem
Modified: pypy/dist/pypy/lang/js/jsparser.py
==============================================================================
--- pypy/dist/pypy/lang/js/jsparser.py (original)
+++ pypy/dist/pypy/lang/js/jsparser.py Sat Feb 3 14:35:13 2007
@@ -28,12 +28,9 @@
jsdir = py.path.local(__file__).dirpath().join("js")
jsdefs = jsdir.join("jsdefs.js").read()
jsparse = jsdir.join("jsparse.js").read()
- f = open('/tmp/jstobeparsed.js','w')
- f.write(jsdefs)
- f.write(jsparse)
- f.write("print(parse('%s'));\n" % stripped_code)
- f.close()
- pipe = os.popen("js -f /tmp/jstobeparsed.js", 'r')
+ f = py.test.ensuretemp("jsinterp").join("tobeparsed.js")
+ f.write(jsdefs+jsparse+"print(parse('%s'));\n" % stripped_code)
+ pipe = os.popen("js -f "+str(f), 'r')
retval = pipe.read()
if not retval.startswith("{"):
raise JsSyntaxError(retval)
More information about the Pypy-commit
mailing list