diff options
author | Raymond Hettinger <python@rcn.com> | 2008-02-01 20:38:12 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-02-01 20:38:12 (GMT) |
commit | 86173daf8d7a4d69a7109bac1d658d2368dddee3 (patch) | |
tree | 5959486c17a56a671c4e4e440a047eded94f45bf /Lib/decimal.py | |
parent | 48aa4b15843ba5e2eab3c4295e4e81df26f1192a (diff) | |
download | cpython-86173daf8d7a4d69a7109bac1d658d2368dddee3.zip cpython-86173daf8d7a4d69a7109bac1d658d2368dddee3.tar.gz cpython-86173daf8d7a4d69a7109bac1d658d2368dddee3.tar.bz2 |
Context flags get set, not incremented.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 1652914..5207a47 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -3411,7 +3411,7 @@ class Context(object): traps - If traps[exception] = 1, then the exception is raised when it is caused. Otherwise, a value is substituted in. - flags - When an exception is caused, flags[exception] is incremented. + flags - When an exception is caused, flags[exception] is set. (Whether or not the trap_enabler is set) Should be reset by user of Decimal instance. Emin - Minimum exponent @@ -3477,16 +3477,16 @@ class Context(object): """Handles an error If the flag is in _ignored_flags, returns the default response. - Otherwise, it increments the flag, then, if the corresponding + Otherwise, it sets the flag, then, if the corresponding trap_enabler is set, it reaises the exception. Otherwise, it returns - the default value after incrementing the flag. + the default value after setting the flag. """ error = _condition_map.get(condition, condition) if error in self._ignored_flags: # Don't touch the flag return error().handle(self, *args) - self.flags[error] += 1 + self.flags[error] = 1 if not self.traps[error]: # The errors define how to handle themselves. return condition().handle(self, *args) |