Show More
@@ -141,16 +141,15 b' def checkportisavailable(port):' | |||
|
141 | 141 | family = socket.AF_INET6 |
|
142 | 142 | else: |
|
143 | 143 | family = socket.AF_INET |
|
144 |
|
|
|
145 | try: | |
|
146 | s = socket.socket(family, socket.SOCK_STREAM) | |
|
147 | s.bind(('localhost', port)) | |
|
148 | s.close() | |
|
149 | return True | |
|
150 | except socket.error as exc: | |
|
151 | if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL, | |
|
152 | errno.EPROTONOSUPPORT): | |
|
153 | raise | |
|
144 | try: | |
|
145 | s = socket.socket(family, socket.SOCK_STREAM) | |
|
146 | s.bind(('localhost', port)) | |
|
147 | s.close() | |
|
148 | return True | |
|
149 | except socket.error as exc: | |
|
150 | if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL, | |
|
151 | errno.EPROTONOSUPPORT): | |
|
152 | raise | |
|
154 | 153 | return False |
|
155 | 154 | |
|
156 | 155 | closefds = os.name == 'posix' |
General Comments 0
You need to be logged in to leave comments.
Login now