]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed a couple of bugs: getargs doesn't use % escapes, and seconds
authorSjoerd Mullender <sjoerd@acm.org>
Tue, 2 Nov 1993 15:34:23 +0000 (15:34 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Tue, 2 Nov 1993 15:34:23 +0000 (15:34 +0000)
must be set after timeout is initialized.

Modules/selectmodule.c

index 77ea61cc16d33a9030739413437af3107acb16d1..2cae7f44d9182c5c058961dced1a34bf6a1d612b 100644 (file)
@@ -125,12 +125,12 @@ select_select(self, args)
 
     /* Get args. Looks funny because of optional timeout argument */
     if ( getargs(args, "(OOOO)", &ifdlist, &ofdlist, &efdlist, &tout) ) {
-       seconds = (int)timeout;
        if (tout == None)
            tvp = (struct timeval *)0;
        else {
-           if (!getargs(tout, "%d;timeout must be float or None", &timeout))
+           if (!getargs(tout, "d;timeout must be float or None", &timeout))
                    return NULL;
+           seconds = (int)timeout;
            timeout = timeout - (double)seconds;
            tv.tv_sec = seconds;
            tv.tv_usec = (int)(timeout*1000000.0);