summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
commitdd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch)
treeb2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Python/pythonrun.c
parente98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff)
downloadcpython-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/pythonrun.c')
-rw-r--r--Python/pythonrun.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 26557ca..785519b 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -495,7 +495,7 @@ Py_Finalize(void)
PyTuple_Fini();
PyList_Fini();
PySet_Fini();
- PyBytes_Fini();
+ PyString_Fini();
PyByteArray_Fini();
PyInt_Fini();
PyFloat_Fini();
@@ -744,12 +744,12 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flag
}
v = PySys_GetObject("ps1");
if (v == NULL) {
- PySys_SetObject("ps1", v = PyBytes_FromString(">>> "));
+ PySys_SetObject("ps1", v = PyString_FromString(">>> "));
Py_XDECREF(v);
}
v = PySys_GetObject("ps2");
if (v == NULL) {
- PySys_SetObject("ps2", v = PyBytes_FromString("... "));
+ PySys_SetObject("ps2", v = PyString_FromString("... "));
Py_XDECREF(v);
}
for (;;) {
@@ -796,16 +796,16 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
v = PyObject_Str(v);
if (v == NULL)
PyErr_Clear();
- else if (PyBytes_Check(v))
- ps1 = PyBytes_AsString(v);
+ else if (PyString_Check(v))
+ ps1 = PyString_AsString(v);
}
w = PySys_GetObject("ps2");
if (w != NULL) {
w = PyObject_Str(w);
if (w == NULL)
PyErr_Clear();
- else if (PyBytes_Check(w))
- ps2 = PyBytes_AsString(w);
+ else if (PyString_Check(w))
+ ps2 = PyString_AsString(w);
}
arena = PyArena_New();
if (arena == NULL) {
@@ -898,7 +898,7 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
return -1;
d = PyModule_GetDict(m);
if (PyDict_GetItemString(d, "__file__") == NULL) {
- PyObject *f = PyBytes_FromString(filename);
+ PyObject *f = PyString_FromString(filename);
if (f == NULL)
return -1;
if (PyDict_SetItemString(d, "__file__", f) < 0) {
@@ -982,7 +982,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
goto finally;
if (v == Py_None)
*filename = NULL;
- else if (! (*filename = PyBytes_AsString(v)))
+ else if (! (*filename = PyString_AsString(v)))
goto finally;
Py_DECREF(v);
@@ -1014,7 +1014,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
goto finally;
if (v == Py_None)
*text = NULL;
- else if (! (*text = PyBytes_AsString(v)))
+ else if (! (*text = PyString_AsString(v)))
goto finally;
Py_DECREF(v);
return 1;
@@ -1237,7 +1237,7 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
if (moduleName == NULL)
err = PyFile_WriteString("<unknown>", f);
else {
- char* modstr = PyBytes_AsString(moduleName);
+ char* modstr = PyString_AsString(moduleName);
if (modstr && strcmp(modstr, "exceptions"))
{
err = PyFile_WriteString(modstr, f);
@@ -1261,8 +1261,8 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
*/
if (s == NULL)
err = -1;
- else if (!PyBytes_Check(s) ||
- PyBytes_GET_SIZE(s) != 0)
+ else if (!PyString_Check(s) ||
+ PyString_GET_SIZE(s) != 0)
err = PyFile_WriteString(": ", f);
if (err == 0)
err = PyFile_WriteObject(s, f, Py_PRINT_RAW);
@@ -1581,7 +1581,7 @@ err_input(perrdetail *err)
if (value != NULL) {
u = PyObject_Str(value);
if (u != NULL) {
- msg = PyBytes_AsString(u);
+ msg = PyString_AsString(u);
}
}
if (msg == NULL)