[pypy-svn] r73537 - in pypy/branch/cpython-extension/pypy/module/cpyext: include src

jandem at codespeak.net jandem at codespeak.net
Thu Apr 8 11:29:16 CEST 2010


Author: jandem
Date: Thu Apr  8 11:29:15 2010
New Revision: 73537

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/include/stringobject.h
   pypy/branch/cpython-extension/pypy/module/cpyext/src/stringobject.c
Log:
add PyString_FromFormat


Modified: pypy/branch/cpython-extension/pypy/module/cpyext/include/stringobject.h
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/include/stringobject.h	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/stringobject.h	Thu Apr  8 11:29:15 2010
@@ -17,6 +17,7 @@
 } PyStringObject;
 
 PyObject *PyString_FromFormatV(char *format, va_list vargs);
+PyObject *PyString_FromFormat(const char *format, ...);
 
 #ifdef __cplusplus
 }

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/src/stringobject.c
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/src/stringobject.c	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/src/stringobject.c	Thu Apr  8 11:29:15 2010
@@ -231,3 +231,19 @@
 	_PyString_Resize(&string, s - PyString_AS_STRING(string));
 	return string;
 }
+
+PyObject *
+PyString_FromFormat(const char *format, ...)
+{
+	PyObject* ret;
+	va_list vargs;
+
+#ifdef HAVE_STDARG_PROTOTYPES
+	va_start(vargs, format);
+#else
+	va_start(vargs);
+#endif
+	ret = PyString_FromFormatV(format, vargs);
+	va_end(vargs);
+	return ret;
+}



More information about the Pypy-commit mailing list