[issue9152] Dead code in datetime module

Alexander Belopolsky report at bugs.python.org
Sun Jul 4 05:39:25 CEST 2010


New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:

Apparently introduced by a wholesale elimination of PyString_ in r57374, the else clause in the following snippet from call_tzname is redundant:



        if (!PyUnicode_Check(result)) {
            PyErr_Format(PyExc_TypeError, "tzinfo.tzname() must "
                         "return None or a string, not '%s'",
                         Py_TYPE(result)->tp_name);
            Py_DECREF(result);
            result = NULL;
        }
        else if (!PyUnicode_Check(result)) {
            PyObject *temp = PyUnicode_FromObject(result);
            Py_DECREF(result);
            result = temp;
        }

----------
assignee: belopolsky
components: Extension Modules
keywords: easy
messages: 109203
nosy: belopolsky
priority: normal
severity: normal
status: open
title: Dead code in datetime module
type: resource usage
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9152>
_______________________________________


More information about the Python-bugs-list mailing list