Mercurial > cpython-lru_cache-weakref
diff Python/modsupport.c @ 47527:52294af4b663 legacy-trunk
This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
| author | Gregory P. Smith <greg@mad-scientist.com> |
|---|---|
| date | Mon, 09 Jun 2008 04:58:54 +0000 |
| parents | 4fe192d48960 |
| children | fd25030223b0 |
line wrap: on
line diff
--- a/Python/modsupport.c Mon Jun 09 01:28:30 2008 +0000 +++ b/Python/modsupport.c Mon Jun 09 04:58:54 2008 +0000 @@ -65,7 +65,7 @@ return NULL; d = PyModule_GetDict(m); if (methods != NULL) { - n = PyBytes_FromString(name); + n = PyString_FromString(name); if (n == NULL) return NULL; for (ml = methods; ml->ml_name != NULL; ml++) { @@ -92,7 +92,7 @@ Py_DECREF(n); } if (doc != NULL) { - v = PyBytes_FromString(doc); + v = PyString_FromString(doc); if (v == NULL || PyDict_SetItemString(d, "__doc__", v) != 0) { Py_XDECREF(v); return NULL; @@ -391,7 +391,7 @@ { char p[1]; p[0] = (char)va_arg(*p_va, int); - return PyBytes_FromStringAndSize(p, 1); + return PyString_FromStringAndSize(p, 1); } case 's': @@ -423,7 +423,7 @@ } n = (Py_ssize_t)m; } - v = PyBytes_FromStringAndSize(str, n); + v = PyString_FromStringAndSize(str, n); } return v; } @@ -633,7 +633,7 @@ int PyModule_AddStringConstant(PyObject *m, const char *name, const char *value) { - PyObject *o = PyBytes_FromString(value); + PyObject *o = PyString_FromString(value); if (!o) return -1; if (PyModule_AddObject(m, name, o) == 0)
