[Python-checkins] r65645 - python/trunk/Lib/multiprocessing/connection.py

jesse.noller python-checkins at python.org
Mon Aug 11 21:00:15 CEST 2008


Author: jesse.noller
Date: Mon Aug 11 21:00:15 2008
New Revision: 65645

Log:
Fix the connection refused error part of issue 3419, use errno module instead of a static list of possible connection refused messages.


Modified:
   python/trunk/Lib/multiprocessing/connection.py

Modified: python/trunk/Lib/multiprocessing/connection.py
==============================================================================
--- python/trunk/Lib/multiprocessing/connection.py	(original)
+++ python/trunk/Lib/multiprocessing/connection.py	Mon Aug 11 21:00:15 2008
@@ -11,6 +11,7 @@
 import os
 import sys
 import socket
+import errno
 import time
 import tempfile
 import itertools
@@ -250,7 +251,7 @@
         try:
             s.connect(address)
         except socket.error, e:
-            if e.args[0] != 10061:    # 10061 => connection refused
+            if e.args[0] != errno.ECONNREFUSED: # connection refused
                 debug('failed to connect to address %s', address)
                 raise
             time.sleep(0.01)


More information about the Python-checkins mailing list