[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-03-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: _dummy_thread patch committed in r88699, thank you! -- ___ Python tracker ___ ___ Python-bugs-list

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-03-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hello, > Shouldn't this be fixed in _dummy_thread too? > > Attached patch contains fix + test. Oops, thanks for noticing. > (Unfortunately, I was not able to run the tests with my patch: > `python3.2 -m test.regrtest test_dummy_thread` tests my 'system' > ve

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-02-28 Thread aaugustin
aaugustin added the comment: Shouldn't this be fixed in _dummy_thread too? Attached patch contains fix + test. (Unfortunately, I was not able to run the tests with my patch: `python3.2 -m test.regrtest test_dummy_thread` tests my 'system' version, not my svn checkout. I did not change the t

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-02-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed in r88682, thank you! -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker _

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-02-27 Thread Filip GruszczyƄski
Filip GruszczyƄski added the comment: Test for releasing unacquired lock and aliasing exception. -- keywords: +patch nosy: +gruszczy Added file: http://bugs.python.org/file20936/11140.patch ___ Python tracker

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-02-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > aaugustin added the comment: > > I agree with your solution. Unfortunately, I do not know how you would > redefine ThreadError to extend RuntimeError in a C extension. > > _thread.error is created line 741 in trunk/Modules/threadmodule.c: > ThreadError = Py

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-02-07 Thread aaugustin
aaugustin added the comment: I agree with your solution. Unfortunately, I do not know how you would redefine ThreadError to extend RuntimeError in a C extension. _thread.error is created line 741 in trunk/Modules/threadmodule.c: ThreadError = PyErr_NewException("thread.error", NULL, NULL); d

[issue11140] threading.Lock().release() raises _thread.error, not RuntimeError

2011-02-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would rather make _thread.error an alias of RuntimeError. That way, we can reconcile the docs and the code without breaking compatibility. Also, importing _thread won't be necessary to catch errors raised in threading objects. -- nosy: +gregory.p.sm