select on windows: must import socket first?

Grant Edwards grante at visi.com
Thu May 29 17:44:04 EDT 2003


In article <3ed67de7$0$49112$e4fe514c at news.xs4all.nl>, Irmen de Jong wrote:
> When using select() on windows, without import socket first, I get this:
> 
> Python 2.3b1 (#40, Apr 25 2003, 19:06:24) [MSC v.1200 32 bit (Intel)] onwin32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import select
> >>> select.select([],[],[])
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
> select.error: (10093, 'Either the application has not called WSAStartup, or 
> WSAStartup failed')
> >>>
> 
> 
> Is this intentionally? I can't seem to find anything in the docs that says 
> that I have to import socket first. (because that gets rid of this error).

Under Windows, select can't be used for anything except
sockets, so there's really no use for importing select w/o
importing socket.  I suppose you could put a call in the select
module to start up winsock if it hasn't already been done, but
what's the point?

I'm guessing that the select call is probably actually part of
winsock and not really part of Win32...

-- 
Grant Edwards                   grante             Yow!  Are we THERE yet? My
                                  at               MIND is a SUBMARINE!!
                               visi.com            




More information about the Python-list mailing list