This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Pruning threading.py from asserts
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: collinwinter, sonderblade
Priority: normal Keywords: patch

Created on 2007-06-04 22:17 by sonderblade, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_threading-check-for-runtimeerrors2.patch sonderblade, 2007-06-04 22:56 Spelled acquire correctly, one method should return a ValueError instead
threading.py-use-real-exceptions.py sonderblade, 2007-06-04 23:05 The aforementioned documentation and code changes
Messages (5)
msg52712 - (view) Author: Björn Lindqvist (sonderblade) Date: 2007-06-04 22:17
threading.py heavily uses asserts to protect against undefined behavior. That's no good, because asserts are removed when Python is run with the -O option. 

The suggested fix is to replace all, or almost all, assertions with more robust RuntimeErrors. 

The whole change is split in two parts. First a patch which adds tests for the new behavior. Then a patch which fixes threading.py and adds the necessary documentation.
msg52713 - (view) Author: Björn Lindqvist (sonderblade) Date: 2007-06-04 22:19
File Added: test_threading-check-for-runtimeerrors.patch
msg52714 - (view) Author: Björn Lindqvist (sonderblade) Date: 2007-06-04 22:56
File Added: test_threading-check-for-runtimeerrors2.patch
msg52715 - (view) Author: Björn Lindqvist (sonderblade) Date: 2007-06-04 23:05
File Added: threading.py-use-real-exceptions.py
msg52716 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-06-06 00:17
Applied to trunk as r55785. Thanks!
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 45037
2007-06-04 22:17:26sonderbladecreate