@@ -7221,15 +7221,20 @@ old replaced by new. If the optional argument count is\n\
72217221given, only the first count occurrences are replaced." );
72227222
72237223static PyObject *
7224- unicode_replace (PyUnicodeObject * self , PyObject * args )
7224+ // Pyston change: don't use varags calling convention
7225+ // unicode_replace(PyUnicodeObject *self, PyObject *args)
7226+ unicode_replace (PyUnicodeObject * self , PyUnicodeObject * str1 , PyUnicodeObject * str2 , PyObject * * args )
72257227{
7226- PyUnicodeObject * str1 ;
7227- PyUnicodeObject * str2 ;
7228+ PyObject * _maxcount = args [0 ];
72287229 Py_ssize_t maxcount = -1 ;
72297230 PyObject * result ;
72307231
7231- if (!PyArg_ParseTuple (args , "OO|n:replace" , & str1 , & str2 , & maxcount ))
7232+ // Pyston change: don't use varags calling convention
7233+ // if (!PyArg_ParseTuple(args, "OO|n:replace", &str1, &str2, &maxcount))
7234+ // return NULL;
7235+ if (_maxcount && !PyArg_ParseSingle (_maxcount , 3 , "replace" , "n" , & maxcount ))
72327236 return NULL ;
7237+
72337238 str1 = (PyUnicodeObject * )PyUnicode_FromObject ((PyObject * )str1 );
72347239 if (str1 == NULL )
72357240 return NULL ;
@@ -7832,7 +7837,7 @@ unicode_getnewargs(PyUnicodeObject *v)
78327837
78337838static PyMethodDef unicode_methods [] = {
78347839 {"encode" , (PyCFunction ) unicode_encode , METH_VARARGS | METH_KEYWORDS , encode__doc__ },
7835- {"replace" , (PyCFunction ) unicode_replace , METH_VARARGS , replace__doc__ },
7840+ {"replace" , (PyCFunction ) unicode_replace , METH_O3 | METH_D1 , replace__doc__ },
78367841 {"split" , (PyCFunction ) unicode_split , METH_VARARGS , split__doc__ },
78377842 {"rsplit" , (PyCFunction ) unicode_rsplit , METH_VARARGS , rsplit__doc__ },
78387843 {"join" , (PyCFunction ) unicode_join , METH_O , join__doc__ },
0 commit comments