From: <pj...@us...> - 2010-04-14 02:40:01
|
Revision: 7026 http://jython.svn.sourceforge.net/jython/?rev=7026&view=rev Author: pjenvey Date: 2010-04-14 02:39:55 +0000 (Wed, 14 Apr 2010) Log Message: ----------- make the SynchronizedCallable callable fixes #1596 Modified Paths: -------------- trunk/jython/Lib/test/test_thread_jy.py trunk/jython/NEWS trunk/jython/src/org/python/modules/synchronize.java Modified: trunk/jython/Lib/test/test_thread_jy.py =================================================================== --- trunk/jython/Lib/test/test_thread_jy.py 2010-04-14 01:59:14 UTC (rev 7025) +++ trunk/jython/Lib/test/test_thread_jy.py 2010-04-14 02:39:55 UTC (rev 7026) @@ -8,12 +8,13 @@ class AllocateLockTest(unittest.TestCase): def test_lock_type(self): - "thread.LockType should exist" + """thread.LockType should exist""" t = thread.LockType self.assertEquals(t, type(thread.allocate_lock()), "thread.LockType has wrong value") class SynchronizeTest(unittest.TestCase): + def test_make_synchronized(self): doneSignal = CountDownLatch(10) class SynchedRunnable(Runnable): @@ -28,7 +29,10 @@ doneSignal.await() self.assertEquals(10, runner.i) + def test_synchronized_callable(self): + self.assertTrue(callable(synchronize.make_synchronized(lambda: None))) + def test_main(): test.test_support.run_unittest(AllocateLockTest, SynchronizeTest) Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-04-14 01:59:14 UTC (rev 7025) +++ trunk/jython/NEWS 2010-04-14 02:39:55 UTC (rev 7026) @@ -32,6 +32,7 @@ - [ 1390 ] ihooks fails due to unimplemented methods in imp module - [ 1456 ] sys.trace/profile attributes cause: AttributeError: write-only attr: trace in PyAMF - [ 1385 ] generator.throw uncaught on new generator doesn't stop the generator + - [ 1596 ] SynchronizedCallable does not report that it is callable [suggested fix] - Fix runtime issues during exitfuncs triggered via SystemRestart (such as during Django or Pylons development mode reloading) - Fix pickling of collections.defaultdict objects Modified: trunk/jython/src/org/python/modules/synchronize.java =================================================================== --- trunk/jython/src/org/python/modules/synchronize.java 2010-04-14 01:59:14 UTC (rev 7025) +++ trunk/jython/src/org/python/modules/synchronize.java 2010-04-14 02:39:55 UTC (rev 7026) @@ -89,5 +89,10 @@ return callable.__call__(arg1, args, keywords); } } + + @Override + public boolean isCallable() { + return true; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |