[pygobject] s/METH_KEYWORDS/METH_VARARGS|METH_KEYWORDS/ when defining object methods



commit 928f4485041d80d0c36ff2daeae4bcd09bd0bde4
Author: John (J5) Palmieri <johnp redhat com>
Date:   Thu Sep 9 12:45:21 2010 -0400

    s/METH_KEYWORDS/METH_VARARGS|METH_KEYWORDS/ when defining object methods
    
    * in Py3k the METH_KEYWORDS flag by itself is invalid.  A method must be defined
      with both the METH_VARARGS and METH_KEYWORDS flags.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=615872

 glib/pygiochannel.c |   30 +++++++++++++++---------------
 glib/pygsource.c    |    4 ++--
 gobject/pygobject.c |    2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/glib/pygiochannel.c b/glib/pygiochannel.c
index 37b1459..f7e2bc4 100644
--- a/glib/pygiochannel.c
+++ b/glib/pygiochannel.c
@@ -667,29 +667,29 @@ static PyMemberDef py_io_channel_members[] = {
 };
 
 static PyMethodDef py_io_channel_methods[] = {
-    { "close", (PyCFunction)py_io_channel_shutdown, METH_KEYWORDS },
+    { "close", (PyCFunction)py_io_channel_shutdown, METH_VARARGS|METH_KEYWORDS },
     { "flush", (PyCFunction)py_io_channel_flush, METH_NOARGS },
-    { "set_encoding", (PyCFunction)py_io_channel_set_encoding, METH_KEYWORDS },
+    { "set_encoding", (PyCFunction)py_io_channel_set_encoding, METH_VARARGS|METH_KEYWORDS },
     { "get_encoding", (PyCFunction)py_io_channel_get_encoding, METH_NOARGS },
-    { "set_buffered", (PyCFunction)py_io_channel_set_buffered, METH_KEYWORDS },
+    { "set_buffered", (PyCFunction)py_io_channel_set_buffered, METH_VARARGS|METH_KEYWORDS },
     { "get_buffered", (PyCFunction)py_io_channel_get_buffered, METH_NOARGS },
-    { "set_buffer_size", (PyCFunction)py_io_channel_set_buffer_size, METH_KEYWORDS },
+    { "set_buffer_size", (PyCFunction)py_io_channel_set_buffer_size, METH_VARARGS|METH_KEYWORDS },
     { "get_buffer_size", (PyCFunction)py_io_channel_get_buffer_size, METH_NOARGS },
-    { "read", (PyCFunction)py_io_channel_read_chars, METH_KEYWORDS },
-    { "readline", (PyCFunction)py_io_channel_read_line, METH_KEYWORDS },
-    { "readlines", (PyCFunction)py_io_channel_read_lines, METH_KEYWORDS },
-    { "write", (PyCFunction)py_io_channel_write_chars, METH_KEYWORDS },
-    { "writelines", (PyCFunction)py_io_channel_write_lines, METH_KEYWORDS },
-    { "set_flags", (PyCFunction)py_io_channel_set_flags, METH_KEYWORDS },
+    { "read", (PyCFunction)py_io_channel_read_chars, METH_VARARGS|METH_KEYWORDS },
+    { "readline", (PyCFunction)py_io_channel_read_line, METH_VARARGS|METH_KEYWORDS },
+    { "readlines", (PyCFunction)py_io_channel_read_lines, METH_VARARGS|METH_KEYWORDS },
+    { "write", (PyCFunction)py_io_channel_write_chars, METH_VARARGS|METH_KEYWORDS },
+    { "writelines", (PyCFunction)py_io_channel_write_lines, METH_VARARGS|METH_KEYWORDS },
+    { "set_flags", (PyCFunction)py_io_channel_set_flags, METH_VARARGS|METH_KEYWORDS },
     { "get_flags", (PyCFunction)py_io_channel_get_flags, METH_NOARGS },
     { "get_buffer_condition", (PyCFunction)py_io_channel_get_buffer_condition, METH_NOARGS },
-    { "set_close_on_unref", (PyCFunction)py_io_channel_set_close_on_unref, METH_KEYWORDS },
+    { "set_close_on_unref", (PyCFunction)py_io_channel_set_close_on_unref, METH_VARARGS | METH_KEYWORDS },
     { "get_close_on_unref", (PyCFunction)py_io_channel_get_close_on_unref, METH_NOARGS },
-    { "add_watch", (PyCFunction)py_io_channel_add_watch, METH_KEYWORDS },
-    { "seek", (PyCFunction)py_io_channel_seek, METH_KEYWORDS },
+    { "add_watch", (PyCFunction)py_io_channel_add_watch, METH_VARARGS|METH_KEYWORDS },
+    { "seek", (PyCFunction)py_io_channel_seek, METH_VARARGS|METH_KEYWORDS },
 #ifdef G_OS_WIN32
-    { "win32_make_pollfd", (PyCFunction)py_io_channel_win32_make_pollfd, METH_KEYWORDS },
-    { "win32_poll", (PyCFunction)py_io_channel_win32_poll, METH_KEYWORDS|METH_STATIC },
+    { "win32_make_pollfd", (PyCFunction)py_io_channel_win32_make_pollfd, METH_VARARGS | METH_KEYWORDS },
+    { "win32_poll", (PyCFunction)py_io_channel_win32_poll, METH_VARARGS|METH_KEYWORDS|METH_STATIC },
 #endif
     { NULL, NULL, 0 }
 };
diff --git a/glib/pygsource.c b/glib/pygsource.c
index b0b87b3..3587c38 100644
--- a/glib/pygsource.c
+++ b/glib/pygsource.c
@@ -255,12 +255,12 @@ pyg_source_get_current_time(PyGSource *self)
 }
 
 static PyMethodDef pyg_source_methods[] = {
-    { "attach", (PyCFunction)pyg_source_attach, METH_KEYWORDS },
+    { "attach", (PyCFunction)pyg_source_attach, METH_VARARGS|METH_KEYWORDS },
     { "destroy", (PyCFunction)pyg_source_destroy, METH_NOARGS },
     { "set_callback", (PyCFunction)pyg_source_set_callback, METH_VARARGS },
     { "get_context", (PyCFunction)pyg_source_get_context, METH_NOARGS },
     { "add_poll", (PyCFunction)pyg_source_add_poll, METH_KEYWORDS },
-    { "remove_poll", (PyCFunction)pyg_source_remove_poll, METH_KEYWORDS },
+    { "remove_poll", (PyCFunction)pyg_source_remove_poll, METH_VARARGS|METH_KEYWORDS },
     { "get_current_time", (PyCFunction)pyg_source_get_current_time, METH_NOARGS },
     { NULL, NULL, 0 }
 };
diff --git a/gobject/pygobject.c b/gobject/pygobject.c
index ebb8136..eee3963 100644
--- a/gobject/pygobject.c
+++ b/gobject/pygobject.c
@@ -2054,7 +2054,7 @@ static PyMethodDef pygobject_methods[] = {
     { "get_property", (PyCFunction)pygobject_get_property, METH_VARARGS },
     { "get_properties", (PyCFunction)pygobject_get_properties, METH_VARARGS },
     { "set_property", (PyCFunction)pygobject_set_property, METH_VARARGS },
-    { "set_properties", (PyCFunction)pygobject_set_properties, METH_KEYWORDS },
+    { "set_properties", (PyCFunction)pygobject_set_properties, METH_VARARGS|METH_KEYWORDS },
     { "freeze_notify", (PyCFunction)pygobject_freeze_notify, METH_VARARGS },
     { "notify", (PyCFunction)pygobject_notify, METH_VARARGS },
     { "thaw_notify", (PyCFunction)pygobject_thaw_notify, METH_VARARGS },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]