summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-10 14:30:35 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-10 14:30:35 (GMT)
commita8b5f7d178cfe3ed7aad27e4741e99e8ea5fb48c (patch)
treee471e9befa75f1d5fe8e7da9220e7008389096c7
parent024ef6f493d3edcf121a74055ef65da869e31a5b (diff)
downloadcpython-a8b5f7d178cfe3ed7aad27e4741e99e8ea5fb48c.zip
cpython-a8b5f7d178cfe3ed7aad27e4741e99e8ea5fb48c.tar.gz
cpython-a8b5f7d178cfe3ed7aad27e4741e99e8ea5fb48c.tar.bz2
Remove hard-coded NT constants that are already defined in errno on NT.
Wrap some long lines. Remove unnecessary tuple unpack.
-rw-r--r--Lib/asyncore.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 07f7892..ec769db 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -53,15 +53,8 @@ import sys
import types
import os
-if os.name == 'nt':
- EWOULDBLOCK = 10035
- EINPROGRESS = 10036
- EALREADY = 10037
- ECONNRESET = 10054
- ENOTCONN = 10057
- ESHUTDOWN = 10058
-else:
- from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, ENOTCONN, ESHUTDOWN
+from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
+ ENOTCONN, ESHUTDOWN
try:
socket_map
@@ -264,7 +257,8 @@ class dispatcher:
try:
self.socket.setsockopt (
socket.SOL_SOCKET, socket.SO_REUSEADDR,
- self.socket.getsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1
+ self.socket.getsockopt (socket.SOL_SOCKET,
+ socket.SO_REUSEADDR) | 1
)
except socket.error:
pass
@@ -398,7 +392,7 @@ class dispatcher:
self.handle_expt()
def handle_error (self):
- (file,fun,line), t, v, tbinfo = compact_traceback()
+ nil, t, v, tbinfo = compact_traceback()
# sometimes a user repr method will crash.
try: