[pypy-commit] pypy default: Fix test

amauryfa noreply at buildbot.pypy.org
Fri Feb 24 21:44:10 CET 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r52888:2ca20aeccdd8
Date: 2012-02-24 21:43 +0100
http://bitbucket.org/pypy/pypy/changeset/2ca20aeccdd8/

Log:	Fix test

diff --git a/pypy/module/cpyext/test/test_eval.py b/pypy/module/cpyext/test/test_eval.py
--- a/pypy/module/cpyext/test/test_eval.py
+++ b/pypy/module/cpyext/test/test_eval.py
@@ -117,8 +117,12 @@
         flags = lltype.malloc(PyCompilerFlags, flavor='raw')
         flags.c_cf_flags = rffi.cast(rffi.INT, consts.PyCF_SOURCE_IS_UTF8)
         w_globals = space.newdict()
-        api.PyRun_StringFlags("a = u'caf\xc3\xa9'", Py_single_input,
-                              w_globals, w_globals, flags)
+        buf = rffi.str2charp("a = u'caf\xc3\xa9'")
+        try:
+            api.PyRun_StringFlags(buf, Py_single_input,
+                                  w_globals, w_globals, flags)
+        finally:
+            rffi.free_charp(buf)
         w_a = space.getitem(w_globals, space.wrap("a"))
         assert space.unwrap(w_a) == u'caf\xe9'
         lltype.free(flags, flavor='raw')


More information about the pypy-commit mailing list