[Python-checkins] cpython (3.5): Issue #28701: Revert part of 5bdc8e1a50c8 for the following reasons:
stefan.krah
python-checkins at python.org
Mon Jan 9 07:16:30 EST 2017
https://hg.python.org/cpython/rev/35334a4d41aa
changeset: 106064:35334a4d41aa
branch: 3.5
parent: 106061:8125d9a8152b
user: Stefan Krah <skrah at bytereef.org>
date: Mon Jan 09 13:11:27 2017 +0100
summary:
Issue #28701: Revert part of 5bdc8e1a50c8 for the following reasons:
- There was no real problem to begin with.
- The hypothetical problem has been fixed by 5bdc8e1a50c8.
files:
Modules/_decimal/_decimal.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -1119,12 +1119,12 @@
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;
@@ -1144,10 +1144,10 @@
}
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);
}
}
@@ -2446,14 +2446,14 @@
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 {
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list