##// END OF EJS Templates
utils: catch error: [Errno 98] Address already in use errors
super-admin -
r4882:f20a077b default
parent child Browse files
Show More
@@ -36,6 +36,7 b' import urlobject'
36 import uuid
36 import uuid
37 import getpass
37 import getpass
38 import socket
38 import socket
39 import errno
39 import random
40 import random
40 from functools import update_wrapper, partial, wraps
41 from functools import update_wrapper, partial, wraps
41
42
@@ -1201,7 +1202,11 b' def get_available_port(min_port=40000, m'
1201 sock.close()
1202 sock.close()
1202 break
1203 break
1203 except OSError:
1204 except OSError:
1204 pass
1205 continue
1206 except socket.error as e:
1207 if e.args[0] in [errno.EADDRINUSE, errno.ECONNREFUSED]:
1208 continue
1209 raise
1205
1210
1206 del sock
1211 del sock
1207 return pick_port
1212 return pick_port
General Comments 0
You need to be logged in to leave comments. Login now