]> granicus.if.org Git - python/commitdiff
Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 25 Mar 2002 20:46:46 +0000 (20:46 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 25 Mar 2002 20:46:46 +0000 (20:46 +0000)
Include/Python.h
Modules/_curses_panel.c
Modules/_localemodule.c
Modules/bsddbmodule.c
Modules/md5module.c
Modules/pwdmodule.c
Modules/readline.c
Modules/signalmodule.c
Modules/threadmodule.c

index d1ffc73c416b70cd5e25d18ed3fc2ccf17719168..d3fce4b2caddcf5155b023d9d5f517fd265b3d3d 100644 (file)
 #include "abstract.h"
 
 #define PyArg_GetInt(v, a)     PyArg_Parse((v), "i", (a))
+
+/* PyArg_NoArgs should not be necessary.
+   Set ml_flags in the PyMethodDef to METH_NOARGS. */
 #define PyArg_NoArgs(v)                PyArg_Parse(v, "")
 
 /* Convert a possibly signed character to a nonnegative int */
index 57368681484752a000120a7eedc25224a224f9b1..5603fe97247558039d48a7d2f4ad17cf49274ef8 100644 (file)
@@ -355,14 +355,12 @@ PyTypeObject PyCursesPanel_Type = {
    panel.above() *requires* a panel object in the first place which
    may be undesirable. */
 static PyObject *
-PyCurses_bottom_panel(PyObject *self, PyObject *args)
+PyCurses_bottom_panel(PyObject *self)
 {
     PANEL *pan;
     PyCursesPanelObject *po;
 
     PyCursesInitialised;
-       
-    if (!PyArg_NoArgs(args)) return NULL;
 
     pan = panel_above(NULL);
 
@@ -403,14 +401,12 @@ PyCurses_new_panel(PyObject *self, PyObject *args)
    *requires* a panel object in the first place which may be
    undesirable. */
 static PyObject *
-PyCurses_top_panel(PyObject *self, PyObject *args)
+PyCurses_top_panel(PyObject *self)
 {
     PANEL *pan;
     PyCursesPanelObject *po;
     
     PyCursesInitialised;
-       
-    if (!PyArg_NoArgs(args)) return NULL;
 
     pan = panel_below(NULL);
 
@@ -429,10 +425,9 @@ PyCurses_top_panel(PyObject *self, PyObject *args)
     return (PyObject *)po;
 }
 
-static PyObject *PyCurses_update_panels(PyObject *self, PyObject *args)
+static PyObject *PyCurses_update_panels(PyObject *self)
 { 
     PyCursesInitialised;
-    if (!PyArg_NoArgs(args)) return NULL;
     update_panels();
     Py_INCREF(Py_None);
     return Py_None;
@@ -442,10 +437,10 @@ static PyObject *PyCurses_update_panels(PyObject *self, PyObject *args)
 /* List of functions defined in the module */
 
 static PyMethodDef PyCurses_methods[] = {
-    {"bottom_panel",        (PyCFunction)PyCurses_bottom_panel},
-    {"new_panel",           (PyCFunction)PyCurses_new_panel, METH_VARARGS},
-    {"top_panel",           (PyCFunction)PyCurses_top_panel},
-    {"update_panels",       (PyCFunction)PyCurses_update_panels},
+    {"bottom_panel",        (PyCFunction)PyCurses_bottom_panel,  METH_NOARGS},
+    {"new_panel",           (PyCFunction)PyCurses_new_panel,     METH_VARARGS},
+    {"top_panel",           (PyCFunction)PyCurses_top_panel,     METH_NOARGS},
+    {"update_panels",       (PyCFunction)PyCurses_update_panels, METH_NOARGS},
     {NULL,             NULL}           /* sentinel */
 };
 
index c617bfb47f9bb08cbad70db3dd1ee2b92702957f..cfbef9f432ddac64658d1fe14492adde06108f0b 100644 (file)
@@ -245,15 +245,12 @@ static char localeconv__doc__[] =
 ;
 
 static PyObject*
-PyLocale_localeconv(PyObject* self, PyObject* args)
+PyLocale_localeconv(PyObject* self)
 {
     PyObject* result;
     struct lconv *l;
     PyObject *x;
 
-    if (!PyArg_NoArgs(args))
-        return NULL;
-
     result = PyDict_New();
     if (!result)
         return NULL;
@@ -368,14 +365,11 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
 
 #if defined(MS_WIN32)
 static PyObject*
-PyLocale_getdefaultlocale(PyObject* self, PyObject* args)
+PyLocale_getdefaultlocale(PyObject* self)
 {
     char encoding[100];
     char locale[100];
 
-    if (!PyArg_NoArgs(args))
-        return NULL;
-
     PyOS_snprintf(encoding, sizeof(encoding), "cp%d", GetACP());
 
     if (GetLocaleInfo(LOCALE_USER_DEFAULT,
@@ -408,7 +402,7 @@ PyLocale_getdefaultlocale(PyObject* self, PyObject* args)
 
 #if defined(macintosh)
 static PyObject*
-PyLocale_getdefaultlocale(PyObject* self, PyObject* args)
+PyLocale_getdefaultlocale(PyObject* self)
 {
     return Py_BuildValue("Os", Py_None, PyMac_getscript());
 }
@@ -530,13 +524,13 @@ static struct PyMethodDef PyLocale_Methods[] = {
   {"setlocale", (PyCFunction) PyLocale_setlocale, 
    METH_VARARGS, setlocale__doc__},
   {"localeconv", (PyCFunction) PyLocale_localeconv, 
-   0, localeconv__doc__},
+   METH_NOARGS, localeconv__doc__},
   {"strcoll", (PyCFunction) PyLocale_strcoll, 
    METH_VARARGS, strcoll__doc__},
   {"strxfrm", (PyCFunction) PyLocale_strxfrm, 
    METH_VARARGS, strxfrm__doc__},
 #if defined(MS_WIN32) || defined(macintosh)
-  {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, 0},
+  {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS},
 #endif
 #ifdef HAVE_LANGINFO_H
   {"nl_langinfo", (PyCFunction) PyLocale_nl_langinfo,
index 85dfa8329c1ce0f610c1fa5c8cc299d1ab2757b2..d76762647a7ff8db8d413e62f4206e7c426a9cf5 100644 (file)
@@ -380,10 +380,8 @@ static PyMappingMethods bsddb_as_mapping = {
 };
 
 static PyObject *
-bsddb_close(bsddbobject *dp, PyObject *args)
+bsddb_close(bsddbobject *dp)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
        if (dp->di_bsddb != NULL) {
                int status;
                BSDDB_BGN_SAVE(dp)
@@ -401,7 +399,7 @@ bsddb_close(bsddbobject *dp, PyObject *args)
 }
 
 static PyObject *
-bsddb_keys(bsddbobject *dp, PyObject *args)
+bsddb_keys(bsddbobject *dp)
 {
        PyObject *list, *item=NULL;
        DBT krec, drec;
@@ -409,8 +407,6 @@ bsddb_keys(bsddbobject *dp, PyObject *args)
        int status;
        int err;
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
        check_bsddbobject_open(dp, NULL);
        list = PyList_New(0);
        if (list == NULL)
@@ -562,7 +558,7 @@ bsddb_set_location(bsddbobject *dp, PyObject *key)
 }
 
 static PyObject *
-bsddb_seq(bsddbobject *dp, PyObject *args, int sequence_request)
+bsddb_seq(bsddbobject *dp, int sequence_request)
 {
        int status;
        DBT krec, drec;
@@ -570,9 +566,6 @@ bsddb_seq(bsddbobject *dp, PyObject *args, int sequence_request)
        char *ddata=NULL,dbuf[4096];
        PyObject *result;
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        check_bsddbobject_open(dp, NULL);
        krec.data = 0;
        krec.size = 0;
@@ -598,11 +591,10 @@ bsddb_seq(bsddbobject *dp, PyObject *args, int sequence_request)
                if (status < 0)
                        PyErr_SetFromErrno(BsddbError);
                else
-                       PyErr_SetObject(PyExc_KeyError, args);
+                       PyErr_SetString(PyExc_KeyError, "no key/data pairs");
                return NULL;
        }
 
-       
        if (dp->di_type == DB_RECNO)
                result = Py_BuildValue("is#", *((int*)kdata),
                                       ddata, drec.size);
@@ -615,32 +607,30 @@ bsddb_seq(bsddbobject *dp, PyObject *args, int sequence_request)
 }
 
 static PyObject *
-bsddb_next(bsddbobject *dp, PyObject *key)
+bsddb_next(bsddbobject *dp)
 {
-       return bsddb_seq(dp, key, R_NEXT);
+       return bsddb_seq(dp, R_NEXT);
 }
 static PyObject *
-bsddb_previous(bsddbobject *dp, PyObject *key)
+bsddb_previous(bsddbobject *dp)
 {
-       return bsddb_seq(dp, key, R_PREV);
+       return bsddb_seq(dp, R_PREV);
 }
 static PyObject *
-bsddb_first(bsddbobject *dp, PyObject *key)
+bsddb_first(bsddbobject *dp)
 {
-       return bsddb_seq(dp, key, R_FIRST);
+       return bsddb_seq(dp, R_FIRST);
 }
 static PyObject *
-bsddb_last(bsddbobject *dp, PyObject *key)
+bsddb_last(bsddbobject *dp)
 {
-       return bsddb_seq(dp, key, R_LAST);
+       return bsddb_seq(dp, R_LAST);
 }
 static PyObject *
-bsddb_sync(bsddbobject *dp, PyObject *args)
+bsddb_sync(bsddbobject *dp)
 {
        int status;
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
        check_bsddbobject_open(dp, NULL);
        BSDDB_BGN_SAVE(dp)
        status = (dp->di_bsddb->sync)(dp->di_bsddb, 0);
@@ -652,15 +642,15 @@ bsddb_sync(bsddbobject *dp, PyObject *args)
        return PyInt_FromLong(status = 0);
 }
 static PyMethodDef bsddb_methods[] = {
-       {"close",               (PyCFunction)bsddb_close, METH_OLDARGS},
-       {"keys",                (PyCFunction)bsddb_keys, METH_OLDARGS},
+       {"close",               (PyCFunction)bsddb_close, METH_NOARGS},
+       {"keys",                (PyCFunction)bsddb_keys, METH_NOARGS},
        {"has_key",             (PyCFunction)bsddb_has_key, METH_OLDARGS},
        {"set_location",        (PyCFunction)bsddb_set_location, METH_OLDARGS},
-       {"next",                (PyCFunction)bsddb_next, METH_OLDARGS},
-       {"previous",    (PyCFunction)bsddb_previous, METH_OLDARGS},
-       {"first",               (PyCFunction)bsddb_first, METH_OLDARGS},
-       {"last",                (PyCFunction)bsddb_last, METH_OLDARGS},
-       {"sync",                (PyCFunction)bsddb_sync, METH_OLDARGS},
+       {"next",                (PyCFunction)bsddb_next, METH_NOARGS},
+       {"previous",    (PyCFunction)bsddb_previous, METH_NOARGS},
+       {"first",               (PyCFunction)bsddb_first, METH_NOARGS},
+       {"last",                (PyCFunction)bsddb_last, METH_NOARGS},
+       {"sync",                (PyCFunction)bsddb_sync, METH_NOARGS},
        {NULL,          NULL}           /* sentinel */
 };
 
index 3ddacf54d3a29ead97f6535873ec992d2072ba61..fb904f49f56ef5afc92302de3ed49643bf1bf497 100644 (file)
@@ -70,14 +70,11 @@ arguments.";
 
 
 static PyObject *
-md5_digest(md5object *self, PyObject *args)
+md5_digest(md5object *self)
 {
        MD5_CTX mdContext;
        unsigned char aDigest[16];
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        /* make a temporary copy, and perform the final */
        mdContext = self->md5;
        MD5Final(aDigest, &mdContext);
@@ -94,16 +91,13 @@ including null bytes.";
 
 
 static PyObject *
-md5_hexdigest(md5object *self, PyObject *args)
+md5_hexdigest(md5object *self)
 {
        MD5_CTX mdContext;
        unsigned char digest[16];
        unsigned char hexdigest[32];
        int i, j;
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        /* make a temporary copy, and perform the final */
        mdContext = self->md5;
        MD5Final(digest, &mdContext);
@@ -129,13 +123,10 @@ Like digest(), but returns the digest as a string of hexadecimal digits.";
 
 
 static PyObject *
-md5_copy(md5object *self, PyObject *args)
+md5_copy(md5object *self)
 {
        md5object *md5p;
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        if ((md5p = newmd5object()) == NULL)
                return NULL;
 
@@ -152,9 +143,9 @@ Return a copy (``clone'') of the md5 object.";
 
 static PyMethodDef md5_methods[] = {
        {"update",    (PyCFunction)md5_update,    METH_OLDARGS, update_doc},
-       {"digest",    (PyCFunction)md5_digest,    METH_OLDARGS, digest_doc},
-       {"hexdigest", (PyCFunction)md5_hexdigest, METH_OLDARGS, hexdigest_doc},
-       {"copy",      (PyCFunction)md5_copy,      METH_OLDARGS, copy_doc},
+       {"digest",    (PyCFunction)md5_digest,    METH_NOARGS,  digest_doc},
+       {"hexdigest", (PyCFunction)md5_hexdigest, METH_NOARGS,  hexdigest_doc},
+       {"copy",      (PyCFunction)md5_copy,      METH_NOARGS,  copy_doc},
        {NULL, NULL}                         /* sentinel */
 };
 
index 91989b710eaaf20bf5cadfcd15a7e695fd231bb7..a52d45f515d8f02f90d36f2ffca8124a34d011c7 100644 (file)
@@ -120,12 +120,10 @@ in arbitrary order.\n\
 See pwd.__doc__ for more on password database entries.";
 
 static PyObject *
-pwd_getpwall(PyObject *self, PyObject *args)
+pwd_getpwall(PyObject *self)
 {
        PyObject *d;
        struct passwd *p;
-       if (!PyArg_NoArgs(args))
-               return NULL;
        if ((d = PyList_New(0)) == NULL)
                return NULL;
 #if defined(PYOS_OS2) && defined(PYCC_GCC)
@@ -151,7 +149,7 @@ static PyMethodDef pwd_methods[] = {
        {"getpwuid",    pwd_getpwuid, METH_OLDARGS, pwd_getpwuid__doc__},
        {"getpwnam",    pwd_getpwnam, METH_OLDARGS, pwd_getpwnam__doc__},
 #ifdef HAVE_GETPWENT
-       {"getpwall",    pwd_getpwall, METH_OLDARGS, pwd_getpwall__doc__},
+       {"getpwall",    pwd_getpwall, METH_NOARGS,  pwd_getpwall__doc__},
 #endif
        {NULL,          NULL}           /* sentinel */
 };
index e573773e26494fdc1c4f0a601cdaedc861be6f08..ed78b9224768ab68b54f0868e1d6d0ee13fba3fd 100644 (file)
@@ -237,11 +237,8 @@ static PyObject *endidx = NULL;
 
 /* get the beginning index for the scope of the tab-completion */
 static PyObject *
-get_begidx(PyObject *self, PyObject *args)
+get_begidx(PyObject *self)
 {
-       if(!PyArg_NoArgs(args)) {
-               return NULL;
-       } 
        Py_INCREF(begidx);
        return begidx;
 }
@@ -252,11 +249,8 @@ get the beginning index of the readline tab-completion scope";
 
 /* get the ending index for the scope of the tab-completion */
 static PyObject *
-get_endidx(PyObject *self, PyObject *args)
+get_endidx(PyObject *self)
 {
-       if(!PyArg_NoArgs(args)) {
-               return NULL;
-       } 
        Py_INCREF(endidx);
        return endidx;
 }
@@ -307,11 +301,8 @@ add a line to the history buffer";
 /* get the tab-completion word-delimiters that readline uses */
 
 static PyObject *
-get_completer_delims(PyObject *self, PyObject *args)
+get_completer_delims(PyObject *self)
 {
-       if(!PyArg_NoArgs(args)) {
-               return NULL;
-       }
        return PyString_FromString(rl_completer_word_break_characters);
 }
        
@@ -359,12 +350,10 @@ return the current contents of history item at index.\
 /* Exported function to get current length of history */
 
 static PyObject *
-get_current_history_length(PyObject *self, PyObject *args)
+get_current_history_length(PyObject *self)
 {
        HISTORY_STATE *hist_st;
 
-       if (!PyArg_NoArgs(args))
-               return NULL;
        hist_st = history_get_history_state();
        return PyInt_FromLong(hist_st ? (long) hist_st->length : (long) 0);
 }
@@ -377,10 +366,8 @@ return the current (not the maximum) length of history.\
 /* Exported function to read the current line buffer */
 
 static PyObject *
-get_line_buffer(PyObject *self, PyObject *args)
+get_line_buffer(PyObject *self)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
        return PyString_FromString(rl_line_buffer);
 }
 
@@ -427,7 +414,7 @@ static struct PyMethodDef readline_methods[] =
 {
        {"parse_and_bind", parse_and_bind, METH_VARARGS, doc_parse_and_bind},
        {"get_line_buffer", get_line_buffer, 
-        METH_OLDARGS, doc_get_line_buffer},
+        METH_NOARGS, doc_get_line_buffer},
        {"insert_text", insert_text, METH_VARARGS, doc_insert_text},
        {"redisplay", (PyCFunction)redisplay, METH_NOARGS, doc_redisplay},
        {"read_init_file", read_init_file, METH_VARARGS, doc_read_init_file},
@@ -438,20 +425,20 @@ static struct PyMethodDef readline_methods[] =
        {"get_history_item", get_history_item,
         METH_VARARGS, doc_get_history_item},
        {"get_current_history_length", get_current_history_length,
-        METH_OLDARGS, doc_get_current_history_length},
+        METH_NOARGS, doc_get_current_history_length},
        {"set_history_length", set_history_length, 
         METH_VARARGS, set_history_length_doc},
        {"get_history_length", get_history_length, 
         METH_VARARGS, get_history_length_doc},
        {"set_completer", set_completer, METH_VARARGS, doc_set_completer},
-       {"get_begidx", get_begidx, METH_OLDARGS, doc_get_begidx},
-       {"get_endidx", get_endidx, METH_OLDARGS, doc_get_endidx},
+       {"get_begidx", get_begidx, METH_NOARGS, doc_get_begidx},
+       {"get_endidx", get_endidx, METH_NOARGS, doc_get_endidx},
 
        {"set_completer_delims", set_completer_delims, 
         METH_VARARGS, doc_set_completer_delims},
        {"add_history", py_add_history, METH_VARARGS, doc_add_history},
        {"get_completer_delims", get_completer_delims, 
-        METH_OLDARGS, doc_get_completer_delims},
+        METH_NOARGS, doc_get_completer_delims},
        
        {"set_startup_hook", set_startup_hook, METH_VARARGS, doc_set_startup_hook},
 #ifdef HAVE_RL_PRE_INPUT_HOOK
index b27c4b74a79539358d087c05726ed972b25bc10d..e4298c61f83b1f9889edf36bfe81974915f0fea0 100644 (file)
@@ -163,11 +163,8 @@ Arrange for SIGALRM to arrive after the given number of seconds.";
 
 #ifdef HAVE_PAUSE
 static PyObject *
-signal_pause(PyObject *self, PyObject *args)
+signal_pause(PyObject *self)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        Py_BEGIN_ALLOW_THREADS
        (void)pause();
        Py_END_ALLOW_THREADS
@@ -282,7 +279,7 @@ static PyMethodDef signal_methods[] = {
        {"signal",              signal_signal, METH_OLDARGS, signal_doc},
        {"getsignal",           signal_getsignal, METH_OLDARGS, getsignal_doc},
 #ifdef HAVE_PAUSE
-       {"pause",               signal_pause, METH_OLDARGS, pause_doc},
+       {"pause",               signal_pause, METH_NOARGS, pause_doc},
 #endif
        {"default_int_handler", signal_default_int_handler, 
         METH_OLDARGS, default_int_handler_doc},
index dfc5cbe7920c29962e0aa71c43b88774eedad8f4..cf4d3d5558cc766aa66e7aa05ed42dd0a8fdcfe0 100644 (file)
@@ -87,11 +87,8 @@ and the return value reflects whether the lock is acquired.\n\
 The blocking operation is not interruptible.";
 
 static PyObject *
-lock_PyThread_release_lock(lockobject *self, PyObject *args)
+lock_PyThread_release_lock(lockobject *self)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        /* Sanity check: the lock must be locked */
        if (PyThread_acquire_lock(self->lock_lock, 0)) {
                PyThread_release_lock(self->lock_lock);
@@ -113,11 +110,8 @@ the lock to acquire the lock.  The lock must be in the locked state,\n\
 but it needn't be locked by the same thread that unlocks it.";
 
 static PyObject *
-lock_locked_lock(lockobject *self, PyObject *args)
+lock_locked_lock(lockobject *self)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
-
        if (PyThread_acquire_lock(self->lock_lock, 0)) {
                PyThread_release_lock(self->lock_lock);
                return PyInt_FromLong(0L);
@@ -137,11 +131,11 @@ static PyMethodDef lock_methods[] = {
        {"acquire",      (PyCFunction)lock_PyThread_acquire_lock, 
         METH_OLDARGS, acquire_doc},
        {"release_lock", (PyCFunction)lock_PyThread_release_lock, 
-        METH_OLDARGS, release_doc},
+        METH_NOARGS, release_doc},
        {"release",      (PyCFunction)lock_PyThread_release_lock, 
         METH_OLDARGS, release_doc},
        {"locked_lock",  (PyCFunction)lock_locked_lock,  
-        METH_OLDARGS, locked_doc},
+        METH_NOARGS, locked_doc},
        {"locked",       (PyCFunction)lock_locked_lock,  
         METH_OLDARGS, locked_doc},
        {NULL,           NULL}          /* sentinel */
@@ -267,10 +261,8 @@ when the function raises an unhandled exception; a stack trace will be\n\
 printed unless the exception is SystemExit.\n";
 
 static PyObject *
-thread_PyThread_exit_thread(PyObject *self, PyObject *args)
+thread_PyThread_exit_thread(PyObject *self)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
        PyErr_SetNone(PyExc_SystemExit);
        return NULL;
 }
@@ -295,10 +287,8 @@ thread_PyThread_exit_prog(PyObject *self, PyObject *args)
 #endif
 
 static PyObject *
-thread_PyThread_allocate_lock(PyObject *self, PyObject *args)
+thread_PyThread_allocate_lock(PyObject *self)
 {
-       if (!PyArg_NoArgs(args))
-               return NULL;
        return (PyObject *) newlockobject();
 }
 
@@ -309,11 +299,9 @@ static char allocate_doc[] =
 Create a new lock object.  See LockType.__doc__ for information about locks.";
 
 static PyObject *
-thread_get_ident(PyObject *self, PyObject *args)
+thread_get_ident(PyObject *self)
 {
        long ident;
-       if (!PyArg_NoArgs(args))
-               return NULL;
        ident = PyThread_get_thread_ident();
        if (ident == -1) {
                PyErr_SetString(ThreadError, "no current thread ident");
@@ -341,15 +329,15 @@ static PyMethodDef thread_methods[] = {
                                METH_VARARGS,
                                start_new_doc},
        {"allocate_lock",       (PyCFunction)thread_PyThread_allocate_lock, 
-        METH_OLDARGS, allocate_doc},
+        METH_NOARGS, allocate_doc},
        {"allocate",            (PyCFunction)thread_PyThread_allocate_lock, 
         METH_OLDARGS, allocate_doc},
        {"exit_thread",         (PyCFunction)thread_PyThread_exit_thread, 
-        METH_OLDARGS, exit_doc},
+        METH_NOARGS, exit_doc},
        {"exit",                (PyCFunction)thread_PyThread_exit_thread, 
         METH_OLDARGS, exit_doc},
        {"get_ident",           (PyCFunction)thread_get_ident, 
-        METH_OLDARGS, get_ident_doc},
+        METH_NOARGS, get_ident_doc},
 #ifndef NO_EXIT_PROG
        {"exit_prog",           (PyCFunction)thread_PyThread_exit_prog},
 #endif