[Python-checkins] python/dist/src/Python getargs.c, 2.102.2.2, 2.102.2.3
birkenfeld@users.sourceforge.net
birkenfeld at users.sourceforge.net
Fri Aug 26 08:43:27 CEST 2005
- Previous message: [Python-checkins] python/dist/src/Objects rangeobject.c, 2.53, 2.53.2.1 setobject.c, 1.31.2.3, 1.31.2.4 bufferobject.c, 2.26, 2.26.2.1 sliceobject.c, 2.22, 2.22.4.1
- Next message: [Python-checkins] python/dist/src/Modules arraymodule.c, 2.97, 2.97.2.1 itertoolsmodule.c, 1.39, 1.39.2.1 operator.c, 2.29, 2.29.4.1 _randommodule.c, 1.7, 1.7.4.1 zipimport.c, 1.18, 1.18.2.1 collectionsmodule.c, 1.36, 1.36.2.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18531/Python
Modified Files:
Tag: release24-maint
getargs.c
Log Message:
Disallow keyword arguments for type constructors that don't use them
(fixes #1119418).
Index: getargs.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v
retrieving revision 2.102.2.2
retrieving revision 2.102.2.3
diff -u -d -r2.102.2.2 -r2.102.2.3
--- getargs.c 3 Mar 2005 12:26:20 -0000 2.102.2.2
+++ getargs.c 26 Aug 2005 06:43:16 -0000 2.102.2.3
@@ -1594,3 +1594,29 @@
va_end(vargs);
return 1;
}
+
+
+/* For type constructors that don't take keyword args
+ *
+ * Sets a TypeError and returns 0 if the kwds dict is
+ * not emtpy, returns 1 otherwise
+ */
+int
+_PyArg_NoKeywords(char *funcname, PyObject *kw)
+{
+ if (kw == NULL)
+ return 1;
+ if (!PyDict_CheckExact(kw)) {
+ PyErr_BadInternalCall();
+ return 0;
+ }
+ if (PyDict_Size(kw) == 0)
+ return 1;
+
+ PyErr_Format(PyExc_TypeError, "%s does not take keyword arguments",
+ funcname);
+ return 0;
+}
+
+
+
- Previous message: [Python-checkins] python/dist/src/Objects rangeobject.c, 2.53, 2.53.2.1 setobject.c, 1.31.2.3, 1.31.2.4 bufferobject.c, 2.26, 2.26.2.1 sliceobject.c, 2.22, 2.22.4.1
- Next message: [Python-checkins] python/dist/src/Modules arraymodule.c, 2.97, 2.97.2.1 itertoolsmodule.c, 1.39, 1.39.2.1 operator.c, 2.29, 2.29.4.1 _randommodule.c, 1.7, 1.7.4.1 zipimport.c, 1.18, 1.18.2.1 collectionsmodule.c, 1.36, 1.36.2.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list