mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Fixed a couple of bugs: getargs doesn't use % escapes, and seconds
must be set after timeout is initialized.
This commit is contained in:
parent
b73cc04e62
commit
78ed420314
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue