[Python-checkins] r88708 - in python/branches/py3k: Include/unicodeobject.h Modules/_ctypes/_ctypes.c Modules/_dbmmodule.c Objects/typeobject.c Objects/unicodeobject.c Python/bltinmodule.c Python/compile.c Python/getargs.c

victor.stinner python-checkins at python.org
Wed Mar 2 02:03:12 CET 2011


Author: victor.stinner
Date: Wed Mar  2 02:03:11 2011
New Revision: 88708

Log:
Remove useless argument of _PyUnicode_AsDefaultEncodedString()

Modified:
   python/branches/py3k/Include/unicodeobject.h
   python/branches/py3k/Modules/_ctypes/_ctypes.c
   python/branches/py3k/Modules/_dbmmodule.c
   python/branches/py3k/Objects/typeobject.c
   python/branches/py3k/Objects/unicodeobject.c
   python/branches/py3k/Python/bltinmodule.c
   python/branches/py3k/Python/compile.c
   python/branches/py3k/Python/getargs.c

Modified: python/branches/py3k/Include/unicodeobject.h
==============================================================================
--- python/branches/py3k/Include/unicodeobject.h	(original)
+++ python/branches/py3k/Include/unicodeobject.h	Wed Mar  2 02:03:11 2011
@@ -668,8 +668,7 @@
 
 #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

Modified: python/branches/py3k/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/py3k/Modules/_ctypes/_ctypes.c	(original)
+++ python/branches/py3k/Modules/_ctypes/_ctypes.c	Wed Mar  2 02:03:11 2011
@@ -1826,7 +1826,7 @@
         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);

Modified: python/branches/py3k/Modules/_dbmmodule.c
==============================================================================
--- python/branches/py3k/Modules/_dbmmodule.c	(original)
+++ python/branches/py3k/Modules/_dbmmodule.c	Wed Mar  2 02:03:11 2011
@@ -219,7 +219,7 @@
          return -1;
     }
     if (PyUnicode_Check(arg)) {
-        arg = _PyUnicode_AsDefaultEncodedString(arg, NULL);
+        arg = _PyUnicode_AsDefaultEncodedString(arg);
         if (arg == NULL)
             return -1;
     }

Modified: python/branches/py3k/Objects/typeobject.c
==============================================================================
--- python/branches/py3k/Objects/typeobject.c	(original)
+++ python/branches/py3k/Objects/typeobject.c	Wed Mar  2 02:03:11 2011
@@ -4975,7 +4975,7 @@
         res = slot_tp_repr(self);
         if (!res)
             return NULL;
-        ress = _PyUnicode_AsDefaultEncodedString(res, NULL);
+        ress = _PyUnicode_AsDefaultEncodedString(res);
         Py_DECREF(res);
         return ress;
     }

Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c	(original)
+++ python/branches/py3k/Objects/unicodeobject.c	Wed Mar  2 02:03:11 2011
@@ -1806,14 +1806,11 @@
 }
 
 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 @@
         PyErr_BadArgument();
         return NULL;
     }
-    bytes = _PyUnicode_AsDefaultEncodedString(unicode, NULL);
+    bytes = _PyUnicode_AsDefaultEncodedString(unicode);
     if (bytes == NULL)
         return NULL;
     if (psize != NULL)

Modified: python/branches/py3k/Python/bltinmodule.c
==============================================================================
--- python/branches/py3k/Python/bltinmodule.c	(original)
+++ python/branches/py3k/Python/bltinmodule.c	Wed Mar  2 02:03:11 2011
@@ -511,7 +511,7 @@
 
     if (PyUnicode_Check(cmd)) {
         cf->cf_flags |= PyCF_IGNORE_COOKIE;
-        cmd = _PyUnicode_AsDefaultEncodedString(cmd, NULL);
+        cmd = _PyUnicode_AsDefaultEncodedString(cmd);
         if (cmd == NULL)
             return NULL;
     }

Modified: python/branches/py3k/Python/compile.c
==============================================================================
--- python/branches/py3k/Python/compile.c	(original)
+++ python/branches/py3k/Python/compile.c	Wed Mar  2 02:03:11 2011
@@ -3026,7 +3026,7 @@
     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;

Modified: python/branches/py3k/Python/getargs.c
==============================================================================
--- python/branches/py3k/Python/getargs.c	(original)
+++ python/branches/py3k/Python/getargs.c	Wed Mar  2 02:03:11 2011
@@ -551,7 +551,7 @@
 
 
 #define UNICODE_DEFAULT_ENCODING(arg) \
-    _PyUnicode_AsDefaultEncodedString(arg, NULL)
+    _PyUnicode_AsDefaultEncodedString(arg)
 
 /* Format an error message generated by convertsimple(). */
 


More information about the Python-checkins mailing list