commit | ce2ec49d92b4c31b6ad358402d8a124e7b03e239 | [log] [tgz] |
---|---|---|
author | Stefan Krah <skrah@bytereef.org> | Tue Aug 26 20:49:57 2014 +0200 |
committer | Stefan Krah <skrah@bytereef.org> | Tue Aug 26 20:49:57 2014 +0200 |
tree | 0764b573d13aebb418da0a81577018452ae57ce6 | |
parent | ec9d547edde95783b170cec799e110839a684085 [diff] [blame] |
Issue 22090: Fix '%' formatting for infinities and NaNs.
diff --git a/Lib/decimal.py b/Lib/decimal.py index 04bf5c2..19cc50f 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py
@@ -3665,6 +3665,8 @@ if self._is_special: sign = _format_sign(self._sign, spec) body = str(self.copy_abs()) + if spec['type'] == '%': + body += '%' return _format_align(sign, body, spec) # a type of None defaults to 'g' or 'G', depending on context