diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-02 01:03:11 +0000 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-02 01:03:11 +0000 |
commit | f3fd733f928752c9e35f8f5141a54cd21c0993b5 (patch) | |
tree | e5ed83eca223ac5ee8a0e836dc8ee8206f89f688 | |
parent | 6f58b6b50445be3cbebf592680bab928c4311a89 (diff) | |
download | cpython-git-f3fd733f928752c9e35f8f5141a54cd21c0993b5.tar.gz |
Remove useless argument of _PyUnicode_AsDefaultEncodedString()
-rw-r--r-- | Include/unicodeobject.h | 3 | ||||
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 2 | ||||
-rw-r--r-- | Modules/_dbmmodule.c | 2 | ||||
-rw-r--r-- | Objects/typeobject.c | 2 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 7 | ||||
-rw-r--r-- | Python/bltinmodule.c | 2 | ||||
-rw-r--r-- | Python/compile.c | 2 | ||||
-rw-r--r-- | Python/getargs.c | 2 |
8 files changed, 9 insertions, 13 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 4d2a8e4d63..6c492d1abe 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -668,8 +668,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString( - PyObject *unicode, - const char *errors); + PyObject *unicode); #endif /* Returns a pointer to the default encoding (UTF-8) of the diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index ff35862cb3..d30018b101 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1826,7 +1826,7 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } if (PyUnicode_Check(proto)) { - PyObject *v = _PyUnicode_AsDefaultEncodedString(proto, NULL); + PyObject *v = _PyUnicode_AsDefaultEncodedString(proto); if (!v) goto error; proto_str = PyBytes_AS_STRING(v); diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index 827acce895..69a7112e7d 100644 --- a/Modules/_dbmmodule.c +++ b/Modules/_dbmmodule.c @@ -219,7 +219,7 @@ dbm_contains(PyObject *self, PyObject *arg) return -1; } if (PyUnicode_Check(arg)) { - arg = _PyUnicode_AsDefaultEncodedString(arg, NULL); + arg = _PyUnicode_AsDefaultEncodedString(arg); if (arg == NULL) return -1; } diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 500dfc9600..fa8d15d30d 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4975,7 +4975,7 @@ slot_tp_str(PyObject *self) res = slot_tp_repr(self); if (!res) return NULL; - ress = _PyUnicode_AsDefaultEncodedString(res, NULL); + ress = _PyUnicode_AsDefaultEncodedString(res); Py_DECREF(res); return ress; } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index cd0fccf4b5..e4539cd46a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1806,14 +1806,11 @@ PyUnicode_AsEncodedUnicode(PyObject *unicode, } PyObject * -_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) +_PyUnicode_AsDefaultEncodedString(PyObject *unicode) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) return v; - if (errors != NULL) - Py_FatalError("non-NULL encoding in _PyUnicode_AsDefaultEncodedString"); v = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), NULL); @@ -1959,7 +1956,7 @@ _PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize) PyErr_BadArgument(); return NULL; } - bytes = _PyUnicode_AsDefaultEncodedString(unicode, NULL); + bytes = _PyUnicode_AsDefaultEncodedString(unicode); if (bytes == NULL) return NULL; if (psize != NULL) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index c6bb16c4e1..ca40cb07dc 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -511,7 +511,7 @@ source_as_string(PyObject *cmd, char *funcname, char *what, PyCompilerFlags *cf) if (PyUnicode_Check(cmd)) { cf->cf_flags |= PyCF_IGNORE_COOKIE; - cmd = _PyUnicode_AsDefaultEncodedString(cmd, NULL); + cmd = _PyUnicode_AsDefaultEncodedString(cmd); if (cmd == NULL) return NULL; } diff --git a/Python/compile.c b/Python/compile.c index 1d6e38c22e..53f5a12cc3 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3026,7 +3026,7 @@ expr_constant(struct compiler *c, expr_ty e) case Name_kind: /* optimize away names that can't be reassigned */ id = PyBytes_AS_STRING( - _PyUnicode_AsDefaultEncodedString(e->v.Name.id, NULL)); + _PyUnicode_AsDefaultEncodedString(e->v.Name.id)); if (strcmp(id, "True") == 0) return 1; if (strcmp(id, "False") == 0) return 0; if (strcmp(id, "None") == 0) return 0; diff --git a/Python/getargs.c b/Python/getargs.c index 17d5993c8a..e1cef0cc58 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -551,7 +551,7 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, #define UNICODE_DEFAULT_ENCODING(arg) \ - _PyUnicode_AsDefaultEncodedString(arg, NULL) + _PyUnicode_AsDefaultEncodedString(arg) /* Format an error message generated by convertsimple(). */ |