diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
commit | dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch) | |
tree | b2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Python/modsupport.c | |
parent | e98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff) | |
download | cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.zip cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.bz2 |
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.
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r-- | Python/modsupport.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c index b23749f..d54158f 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -65,7 +65,7 @@ Py_InitModule4(const char *name, PyMethodDef *methods, const char *doc, 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_InitModule4(const char *name, PyMethodDef *methods, const char *doc, 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 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) { 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 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) } n = (Py_ssize_t)m; } - v = PyBytes_FromStringAndSize(str, n); + v = PyString_FromStringAndSize(str, n); } return v; } @@ -633,7 +633,7 @@ PyModule_AddIntConstant(PyObject *m, const char *name, long value) 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) |