summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.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/sysmodule.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/sysmodule.c')
-rw-r--r--Python/sysmodule.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 9564267..64ea89f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -229,7 +229,7 @@ exit status will be one (i.e., failure)."
static PyObject *
sys_getdefaultencoding(PyObject *self)
{
- return PyBytes_FromString(PyUnicode_GetDefaultEncoding());
+ return PyString_FromString(PyUnicode_GetDefaultEncoding());
}
PyDoc_STRVAR(getdefaultencoding_doc,
@@ -261,7 +261,7 @@ static PyObject *
sys_getfilesystemencoding(PyObject *self)
{
if (Py_FileSystemDefaultEncoding)
- return PyBytes_FromString(Py_FileSystemDefaultEncoding);
+ return PyString_FromString(Py_FileSystemDefaultEncoding);
Py_INCREF(Py_None);
return Py_None;
}
@@ -290,7 +290,7 @@ trace_init(void)
int i;
for (i = 0; i < 7; ++i) {
if (whatstrings[i] == NULL) {
- name = PyBytes_InternFromString(whatnames[i]);
+ name = PyString_InternFromString(whatnames[i]);
if (name == NULL)
return -1;
whatstrings[i] = name;
@@ -931,7 +931,7 @@ list_builtin_module_names(void)
if (list == NULL)
return NULL;
for (i = 0; PyImport_Inittab[i].name != NULL; i++) {
- PyObject *name = PyBytes_FromString(
+ PyObject *name = PyString_FromString(
PyImport_Inittab[i].name);
if (name == NULL)
break;
@@ -971,7 +971,7 @@ PySys_AddWarnOption(char *s)
if (warnoptions == NULL)
return;
}
- str = PyBytes_FromString(s);
+ str = PyString_FromString(s);
if (str != NULL) {
PyList_Append(warnoptions, str);
Py_DECREF(str);
@@ -1327,7 +1327,7 @@ _PySys_Init(void)
Py_XDECREF(syserr);
SET_SYS_FROM_STRING("version",
- PyBytes_FromString(Py_GetVersion()));
+ PyString_FromString(Py_GetVersion()));
SET_SYS_FROM_STRING("hexversion",
PyInt_FromLong(PY_VERSION_HEX));
svnversion_init();
@@ -1358,15 +1358,15 @@ _PySys_Init(void)
SET_SYS_FROM_STRING("api_version",
PyInt_FromLong(PYTHON_API_VERSION));
SET_SYS_FROM_STRING("copyright",
- PyBytes_FromString(Py_GetCopyright()));
+ PyString_FromString(Py_GetCopyright()));
SET_SYS_FROM_STRING("platform",
- PyBytes_FromString(Py_GetPlatform()));
+ PyString_FromString(Py_GetPlatform()));
SET_SYS_FROM_STRING("executable",
- PyBytes_FromString(Py_GetProgramFullPath()));
+ PyString_FromString(Py_GetProgramFullPath()));
SET_SYS_FROM_STRING("prefix",
- PyBytes_FromString(Py_GetPrefix()));
+ PyString_FromString(Py_GetPrefix()));
SET_SYS_FROM_STRING("exec_prefix",
- PyBytes_FromString(Py_GetExecPrefix()));
+ PyString_FromString(Py_GetExecPrefix()));
SET_SYS_FROM_STRING("maxsize",
PyInt_FromSsize_t(PY_SSIZE_T_MAX));
SET_SYS_FROM_STRING("maxint",
@@ -1393,13 +1393,13 @@ _PySys_Init(void)
else
value = "little";
SET_SYS_FROM_STRING("byteorder",
- PyBytes_FromString(value));
+ PyString_FromString(value));
}
#ifdef MS_COREDLL
SET_SYS_FROM_STRING("dllhandle",
PyLong_FromVoidPtr(PyWin_DLLhModule));
SET_SYS_FROM_STRING("winver",
- PyBytes_FromString(PyWin_DLLVersionString));
+ PyString_FromString(PyWin_DLLVersionString));
#endif
if (warnoptions == NULL) {
warnoptions = PyList_New(0);
@@ -1444,7 +1444,7 @@ makepathobject(char *path, int delim)
p = strchr(path, delim);
if (p == NULL)
p = strchr(path, '\0'); /* End of string */
- w = PyBytes_FromStringAndSize(path, (Py_ssize_t) (p - path));
+ w = PyString_FromStringAndSize(path, (Py_ssize_t) (p - path));
if (w == NULL) {
Py_DECREF(v);
return NULL;
@@ -1489,14 +1489,14 @@ makeargvobject(int argc, char **argv)
if (i == 0) {
char* fn = decc$translate_vms(argv[0]);
if ((fn == (char *)0) || fn == (char *)-1)
- v = PyBytes_FromString(argv[0]);
+ v = PyString_FromString(argv[0]);
else
- v = PyBytes_FromString(
+ v = PyString_FromString(
decc$translate_vms(argv[0]));
} else
- v = PyBytes_FromString(argv[i]);
+ v = PyString_FromString(argv[i]);
#else
- PyObject *v = PyBytes_FromString(argv[i]);
+ PyObject *v = PyString_FromString(argv[i]);
#endif
if (v == NULL) {
Py_DECREF(av);
@@ -1600,7 +1600,7 @@ PySys_SetArgv(int argc, char **argv)
#endif /* Unix */
}
#endif /* All others */
- a = PyBytes_FromStringAndSize(argv0, n);
+ a = PyString_FromStringAndSize(argv0, n);
if (a == NULL)
Py_FatalError("no mem for sys.path insertion");
if (PyList_Insert(path, 0, a) < 0)