[PYTHONMAC-SIG] need socket error codes

Tim Chase chase@iac.net
Mon, 10 Nov 1997 16:48:57 -0500 (EST)



On Mon, 10 Nov 1997, Joseph J. Strout wrote:

> I'm trying to get Sam Rushing's "asyncore" module to work under MacOS.  It
> looks like it just needs some constants, since on the following code...
> 
> ---
> import os
> if os.name == 'nt':
> 	EWOULDBLOCK	= 10035
> 	EINPROGRESS	= 10036
> 	EALREADY	= 10037
> 	ECONNRESET  = 10054
> 	ENOTCONN	= 10057
> else:
> 	from errno import EALREADY, EINPROGRESS, EWOULDBLOCK,
> ECONNRESET,ENOTCONN
> ---
> 
> we get an "ImportError: No module named errno".  Apparently WinNT doesn't
> ...

I am sure that this is not a good thing to do. But, I have gotten
monitor.py to work by changing 

if os.name == 'nt':

to

if os.name == 'nt' or 'mac':

I haven't used many of the other modules, but monitor.py seemed to work
fine. 


--Tim


Timothy S. Chase
CHASE@IAC.NET
First Assistant, Computer Services
The Public Library of Cincinnati and Hamilton County


_______________
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
_______________