diff options
author | Stefan Krah <skrah@bytereef.org> | 2017-01-09 12:12:09 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2017-01-09 12:12:09 (GMT) |
commit | a40a3f35ebd1c99d7ee4b884f1508fa4136a5fd6 (patch) | |
tree | 99e0dc3726cbe9ae6cff463f87151b45f1504783 /Modules/_decimal | |
parent | 63ac30f5f14d8fa242ffc63a342455ca12abec12 (diff) | |
parent | e660335b7e168bb5e25a5813fefdff71737d63fa (diff) | |
download | cpython-a40a3f35ebd1c99d7ee4b884f1508fa4136a5fd6.zip cpython-a40a3f35ebd1c99d7ee4b884f1508fa4136a5fd6.tar.gz cpython-a40a3f35ebd1c99d7ee4b884f1508fa4136a5fd6.tar.bz2 |
Merge 3.6.
Diffstat (limited to 'Modules/_decimal')
-rw-r--r-- | Modules/_decimal/_decimal.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 846b2a8..88ca87c 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -1118,12 +1118,12 @@ context_getattr(PyObject *self, PyObject *name) PyObject *retval; if (PyUnicode_Check(name)) { - if (_PyUnicode_EqualToASCIIString(name, "traps")) { + if (PyUnicode_CompareWithASCIIString(name, "traps") == 0) { retval = ((PyDecContextObject *)self)->traps; Py_INCREF(retval); return retval; } - if (_PyUnicode_EqualToASCIIString(name, "flags")) { + if (PyUnicode_CompareWithASCIIString(name, "flags") == 0) { retval = ((PyDecContextObject *)self)->flags; Py_INCREF(retval); return retval; @@ -1143,10 +1143,10 @@ context_setattr(PyObject *self, PyObject *name, PyObject *value) } if (PyUnicode_Check(name)) { - if (_PyUnicode_EqualToASCIIString(name, "traps")) { + if (PyUnicode_CompareWithASCIIString(name, "traps") == 0) { return context_settraps_dict(self, value); } - if (_PyUnicode_EqualToASCIIString(name, "flags")) { + if (PyUnicode_CompareWithASCIIString(name, "flags") == 0) { return context_setstatus_dict(self, value); } } @@ -2449,14 +2449,14 @@ dectuple_as_str(PyObject *dectuple) tmp = PyTuple_GET_ITEM(dectuple, 2); if (PyUnicode_Check(tmp)) { /* special */ - if (_PyUnicode_EqualToASCIIString(tmp, "F")) { + if (PyUnicode_CompareWithASCIIString(tmp, "F") == 0) { strcat(sign_special, "Inf"); is_infinite = 1; } - else if (_PyUnicode_EqualToASCIIString(tmp, "n")) { + else if (PyUnicode_CompareWithASCIIString(tmp, "n") == 0) { strcat(sign_special, "NaN"); } - else if (_PyUnicode_EqualToASCIIString(tmp, "N")) { + else if (PyUnicode_CompareWithASCIIString(tmp, "N") == 0) { strcat(sign_special, "sNaN"); } else { |