From 71f3b85497f25bad3b00555173c51378f64edbb5 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Sun, 4 May 2008 02:25:46 +0000 Subject: [PATCH] Make sure that Context traps and flags dictionaries have values 0 and 1 (as documented) rather than True and False. --- Lib/decimal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/decimal.py b/Lib/decimal.py index 6a70ed0548..940a9d24d4 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -3613,10 +3613,10 @@ class Context(object): if _ignored_flags is None: _ignored_flags = [] if not isinstance(flags, dict): - flags = dict([(s,s in flags) for s in _signals]) + flags = dict([(s, int(s in flags)) for s in _signals]) del s if traps is not None and not isinstance(traps, dict): - traps = dict([(s,s in traps) for s in _signals]) + traps = dict([(s, int(s in traps)) for s in _signals]) del s for name, val in locals().items(): if val is None: -- 2.50.1