From: <zy...@us...> - 2009-09-07 20:41:58
|
Revision: 6762 http://jython.svn.sourceforge.net/jython/?rev=6762&view=rev Author: zyasoft Date: 2009-09-07 20:41:45 +0000 (Mon, 07 Sep 2009) Log Message: ----------- Fixed regression where threading._Lock, _RLock were no longer available as synonyms to Lock and RLock respectively, which Twisted needs. Added a test case to prevent recurrence. This resolves #1079. Modified Paths: -------------- trunk/jython/Lib/test/test_threading_jy.py trunk/jython/Lib/threading.py trunk/jython/NEWS trunk/jython/src/org/python/modules/_threading/_threading.java Modified: trunk/jython/Lib/test/test_threading_jy.py =================================================================== --- trunk/jython/Lib/test/test_threading_jy.py 2009-09-06 23:26:58 UTC (rev 6761) +++ trunk/jython/Lib/test/test_threading_jy.py 2009-09-07 20:41:45 UTC (rev 6762) @@ -36,8 +36,14 @@ time.sleep(random.random()) +class TwistedTestCase(unittest.TestCase): + + def test_needs_underscored_versions(self): + self.assertEqual(threading.Lock, threading._Lock) + self.assertEqual(threading.RLock, threading._RLock) + def test_main(): - test_support.run_unittest(ThreadingTestCase) + test_support.run_unittest(ThreadingTestCase, TwistedTestCase) if __name__ == "__main__": Modified: trunk/jython/Lib/threading.py =================================================================== --- trunk/jython/Lib/threading.py 2009-09-06 23:26:58 UTC (rev 6761) +++ trunk/jython/Lib/threading.py 2009-09-07 20:41:45 UTC (rev 6762) @@ -5,7 +5,7 @@ from org.python.util import jython from thread import _newFunctionThread from thread import _local as local -from _threading import Lock, RLock, Condition +from _threading import Lock, RLock, Condition, _Lock, _RLock import java.lang.Thread import weakref Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-09-06 23:26:58 UTC (rev 6761) +++ trunk/jython/NEWS 2009-09-07 20:41:45 UTC (rev 6762) @@ -1,5 +1,9 @@ Jython NEWS +Jython 2.5.1rc2 + Bugs Fixed + - [ 1079 ] fixed regression on issue: twisted.python.threadable module: missing attribute '_RLock' + Jython 2.5.1rc1 New Features - Upgraded to ANTLR 3.1.3 Modified: trunk/jython/src/org/python/modules/_threading/_threading.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/_threading.java 2009-09-06 23:26:58 UTC (rev 6761) +++ trunk/jython/src/org/python/modules/_threading/_threading.java 2009-09-07 20:41:45 UTC (rev 6762) @@ -10,6 +10,8 @@ dict.__setitem__("__name__", Py.newString("_threading")); dict.__setitem__("Lock", Lock.TYPE); dict.__setitem__("RLock", Lock.TYPE); + dict.__setitem__("_Lock", Lock.TYPE); + dict.__setitem__("_RLock", Lock.TYPE); dict.__setitem__("Condition", Condition.TYPE); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |