Issue 987300: decimal.py signal/exception fix (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/40524

classification

Title: decimal.py signal/exception fix
Type: Stage:
Components: Library (Lib) Versions: Python 2.4

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: goodger, rhettinger
Priority: normal Keywords: patch

Created on 2004-07-08 13:55 by goodger, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
decimal.py.diff goodger,2004-07-08 13:57 patch to dist/src/Lib/decimal.py
Messages (3)
msg46331 - (view) Author: David Goodger (goodger) (Python committer) Date: 2004-07-08 13:55
Traps should be set on signals, not conditions. decimal.Signals in the implementation is actually listing conditions. The attached patch brings the implementation into line with the spec & PEP 327. decimal.Signals is changed to list signals, not conditions. Context._raise_error is modified to handle signals properly. 19 tests fail in test_decimal.py, but I'm not sure how to fix it.
msg46332 - (view) Author: David Goodger (goodger) (Python committer) Date: 2004-07-08 14:06
Logged In: YES user_id=7733 It's a start. The docs would also need changes to explain the difference between signals and conditions, and how to enable traps. A boolean "signal" attribute on exceptions may help. Set DecimalException.signal to False, set .signal on individual signal exceptions to True, and .signal on InvalidOperation subclasses to False.
msg46333 - (view) Author: David Goodger (goodger) (Python committer) Date: 2004-07-10 03:19
Logged In: YES user_id=7733 Fixed in decimal.py revision 1.13.
History
Date User Action Args
2022-04-11 14:56:05 admin set github: 40524
2004-07-08 13:55:46 goodger create