]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
call_utc_tzinfo_method(): Got rid of the label and the gotos.
authorTim Peters <tim.peters@gmail.com>
Mon, 23 Dec 2002 16:17:39 +0000 (16:17 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 23 Dec 2002 16:17:39 +0000 (16:17 +0000)
Modules/datetimemodule.c

index a9675d60515f26d1d6487bd2c1fe39aa1248234f..250ee236ac02edfcb4e4da24b5e9ba5be071efbb 100644 (file)
@@ -627,13 +627,11 @@ call_utc_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg,
        if (u == NULL)
                return -1;
 
-       if (u == Py_None) {
+       else if (u == Py_None) {
                result = 0;
                *none = 1;
-               goto Done;
        }
-
-       if (PyInt_Check(u))
+       else if (PyInt_Check(u))
                result = PyInt_AS_LONG(u);
 
        else if (PyLong_Check(u))
@@ -655,7 +653,6 @@ call_utc_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg,
                                             "whole number of minutes",
                                             name);
                                result = -1;
-                               goto Done;
                        }
                }
        }
@@ -664,10 +661,8 @@ call_utc_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg,
                             "tzinfo.%s() must return None, integer or "
                             "timedelta, not '%s'",
                             name, u->ob_type->tp_name);
-               goto Done;
        }
 
-Done:
        Py_DECREF(u);
        if (result < -1439 || result > 1439) {
                PyErr_Format(PyExc_ValueError,