diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 1993-11-02 15:34:23 (GMT) |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 1993-11-02 15:34:23 (GMT) |
commit | 78ed420314876083b4cc1739d7dbf04e4f012c03 (patch) | |
tree | aed0a813751de97b12c418adde70a3d3d33b5def | |
parent | b73cc04e625511f41c63b880b418338af70dc8bd (diff) | |
download | cpython-78ed420314876083b4cc1739d7dbf04e4f012c03.zip cpython-78ed420314876083b4cc1739d7dbf04e4f012c03.tar.gz cpython-78ed420314876083b4cc1739d7dbf04e4f012c03.tar.bz2 |
Fixed a couple of bugs: getargs doesn't use % escapes, and seconds
must be set after timeout is initialized.
-rw-r--r-- | Modules/selectmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 77ea61c..2cae7f4 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -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); |