[Jython-checkins] jython (merge default -> default): Merge.
frank.wierzbicki
jython-checkins at python.org
Sat Feb 9 02:05:53 CET 2013
http://hg.python.org/jython/rev/59116fbad826
changeset: 7019:59116fbad826
parent: 7018:3b424500eab9
parent: 7014:a8b0a3007ed3
user: Frank Wierzbicki <fwierzbicki at gmail.com>
date: Fri Feb 08 17:04:59 2013 -0800
summary:
Merge.
files:
Lib/test/test_threading_jy.py | 9 ++++++
NEWS | 4 ++
src/org/python/modules/_threading/Condition.java | 14 ++++++---
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/Lib/test/test_threading_jy.py b/Lib/test/test_threading_jy.py
--- a/Lib/test/test_threading_jy.py
+++ b/Lib/test/test_threading_jy.py
@@ -43,6 +43,15 @@
def _sleep(self, n):
time.sleep(random.random())
+ def test_issue1988(self):
+ cond = threading.Condition(threading.Lock())
+ locked = False
+ try:
+ locked = cond.acquire(False)
+ finally:
+ if locked:
+ cond.release()
+
class TwistedTestCase(unittest.TestCase):
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,10 @@
Bugs Fixed
- [ 1880 ] Sha 224 library not present in Jython
+Jython 2.5.4rc2
+ Bugs Fixed
+ - [ 1988 ] API for threading.condition fails to accept *args for acquire
+
Jython 2.5.4rc1
Bugs Fixed
- [ 1936 ] JBoss 7, vfs protocol in use for jarFileName in PySystemState.
diff --git a/src/org/python/modules/_threading/Condition.java b/src/org/python/modules/_threading/Condition.java
--- a/src/org/python/modules/_threading/Condition.java
+++ b/src/org/python/modules/_threading/Condition.java
@@ -38,12 +38,16 @@
}
public boolean acquire() {
- return Condition_acquire();
+ return Condition_acquire(true);
}
- @ExposedMethod
- final boolean Condition_acquire() {
- return _lock.acquire();
+ public boolean acquire(boolean blocking) {
+ return Condition_acquire(blocking);
+ }
+
+ @ExposedMethod(defaults = "true")
+ final boolean Condition_acquire(boolean blocking) {
+ return _lock.acquire(blocking);
}
public PyObject __enter__(ThreadState ts) {
@@ -53,7 +57,7 @@
@ExposedMethod
final PyObject Condition___enter__() {
- Condition_acquire();
+ Condition_acquire(true);
return this;
}
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list