]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #28701: Revert part of 5bdc8e1a50c8 for the following reasons:
authorStefan Krah <skrah@bytereef.org>
Mon, 9 Jan 2017 12:11:27 +0000 (13:11 +0100)
committerStefan Krah <skrah@bytereef.org>
Mon, 9 Jan 2017 12:11:27 +0000 (13:11 +0100)
  - There was no real problem to begin with.

  - The hypothetical problem has been fixed by 5bdc8e1a50c8.

Modules/_decimal/_decimal.c

index 6efdc91e6716a6a5674320522061e07f87c66685..e15941aec8e175798538bbad948b422ae66067a0 100644 (file)
@@ -1119,12 +1119,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;
@@ -1144,10 +1144,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);
         }
     }
@@ -2446,14 +2446,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 {