[pypy-svn] pypy default: Simplify code, now that pypy natively understands the with statement

amauryfa commits-noreply at bitbucket.org
Thu Feb 10 17:11:00 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r41791:5eb55f87d111
Date: 2011-02-10 15:49 +0100
http://bitbucket.org/pypy/pypy/changeset/5eb55f87d111/

Log:	Simplify code, now that pypy natively understands the with statement

diff --git a/pypy/module/thread/test/test_lock.py b/pypy/module/thread/test/test_lock.py
--- a/pypy/module/thread/test/test_lock.py
+++ b/pypy/module/thread/test/test_lock.py
@@ -1,3 +1,4 @@
+from __future__ import with_statement
 from pypy.module.thread.test.support import GenericTestThread
 from pypy.translator.c.test.test_genc import compile
 
@@ -40,13 +41,9 @@
             lock.release()
         assert lock.locked() is True
         thread.start_new_thread(f, ())
-        exec """
-from __future__ import with_statement
-if 1:
         with lock:
             assert lock.locked() is True
             assert feedback == [42]
-""" in {"lock": lock, "feedback": feedback}
         assert lock.locked() is False
 
 def test_compile_lock():


More information about the Pypy-commit mailing list