Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteaed88c

Browse files
committed
Add function name to PyArg_ParseTuple()
This causes the supplied function name to appear in any error message,making the error message friendlier and relieving us from having toprovide our own in some cases.
1 parent84d457e commiteaed88c

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

‎src/pl/plpython/plpy_cursorobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ PLy_cursor_fetch(PyObject *self, PyObject *args)
406406
volatileResourceOwneroldowner;
407407
Portalportal;
408408

409-
if (!PyArg_ParseTuple(args,"i",&count))
409+
if (!PyArg_ParseTuple(args,"i:fetch",&count))
410410
returnNULL;
411411

412412
cursor= (PLyCursorObject*)self;

‎src/pl/plpython/plpy_planobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,11 @@ PLy_plan_dealloc(PyObject *arg)
114114
staticPyObject*
115115
PLy_plan_status(PyObject*self,PyObject*args)
116116
{
117-
if (PyArg_ParseTuple(args,""))
117+
if (PyArg_ParseTuple(args,":status"))
118118
{
119119
Py_INCREF(Py_True);
120120
returnPy_True;
121121
/* return PyInt_FromLong(self->status); */
122122
}
123-
PLy_exception_set(PLy_exc_error,"plan.status takes no arguments");
124123
returnNULL;
125124
}

‎src/pl/plpython/plpy_plpymodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ PLy_quote_literal(PyObject *self, PyObject *args)
323323
char*quoted;
324324
PyObject*ret;
325325

326-
if (!PyArg_ParseTuple(args,"s",&str))
326+
if (!PyArg_ParseTuple(args,"s:quote_literal",&str))
327327
returnNULL;
328328

329329
quoted=quote_literal_cstr(str);
@@ -340,7 +340,7 @@ PLy_quote_nullable(PyObject *self, PyObject *args)
340340
char*quoted;
341341
PyObject*ret;
342342

343-
if (!PyArg_ParseTuple(args,"z",&str))
343+
if (!PyArg_ParseTuple(args,"z:quote_nullable",&str))
344344
returnNULL;
345345

346346
if (str==NULL)
@@ -360,7 +360,7 @@ PLy_quote_ident(PyObject *self, PyObject *args)
360360
constchar*quoted;
361361
PyObject*ret;
362362

363-
if (!PyArg_ParseTuple(args,"s",&str))
363+
if (!PyArg_ParseTuple(args,"s:quote_ident",&str))
364364
returnNULL;
365365

366366
quoted=quote_identifier(str);

‎src/pl/plpython/plpy_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PLy_spi_prepare(PyObject *self, PyObject *args)
5151
volatileResourceOwneroldowner;
5252
volatileintnargs;
5353

54-
if (!PyArg_ParseTuple(args,"s|O",&query,&list))
54+
if (!PyArg_ParseTuple(args,"s|O:prepare",&query,&list))
5555
returnNULL;
5656

5757
if (list&& (!PySequence_Check(list)))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp