summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-24 19:54:13 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-24 19:54:13 (GMT)
commitcd795963c3fcb7c74a4d8684eb2c09a9f7d1a050 (patch)
tree2a874a578a3e9a741264c883a99877760213a376 /Python
parent11e065b37cd1c62c3f8c293f51ea901169d894f9 (diff)
downloadcpython-cd795963c3fcb7c74a4d8684eb2c09a9f7d1a050.zip
cpython-cd795963c3fcb7c74a4d8684eb2c09a9f7d1a050.tar.gz
cpython-cd795963c3fcb7c74a4d8684eb2c09a9f7d1a050.tar.bz2
Use unicode for much of errors.
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 62e63ab..3ce889e 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -350,7 +350,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
PyObject *
PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
{
- PyObject *name = filename ? PyString_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
Py_XDECREF(name);
return result;
@@ -429,7 +429,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
int ierr,
const char *filename)
{
- PyObject *name = filename ? PyString_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc,
ierr,
name);
@@ -468,7 +468,7 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
int ierr,
const char *filename)
{
- PyObject *name = filename ? PyString_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
PyExc_WindowsError,
ierr, name);
@@ -558,7 +558,7 @@ PyErr_NewException(char *name, PyObject *base, PyObject *dict)
goto failure;
}
if (PyDict_GetItemString(dict, "__module__") == NULL) {
- modulename = PyString_FromStringAndSize(name,
+ modulename = PyUnicode_FromStringAndSize(name,
(Py_ssize_t)(dot-name));
if (modulename == NULL)
goto failure;
@@ -610,7 +610,7 @@ PyErr_WriteUnraisable(PyObject *obj)
if (moduleName == NULL)
PyFile_WriteString("<unknown>", f);
else {
- char* modstr = PyString_AsString(moduleName);
+ char* modstr = PyUnicode_AsString(moduleName);
if (modstr &&
strcmp(modstr, "__builtin__") != 0)
{
@@ -728,7 +728,7 @@ PyErr_SyntaxLocation(const char *filename, int lineno)
Py_DECREF(tmp);
}
if (filename != NULL) {
- tmp = PyString_FromString(filename);
+ tmp = PyUnicode_FromString(filename);
if (tmp == NULL)
PyErr_Clear();
else {
@@ -805,7 +805,7 @@ PyErr_ProgramText(const char *filename, int lineno)
char *p = linebuf;
while (*p == ' ' || *p == '\t' || *p == '\014')
p++;
- return PyString_FromString(p);
+ return PyUnicode_FromString(p);
}
return NULL;
}