Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f9b593

Browse files
committed
<socket>.getsockopt() and <socket>.setsockopt() can only raise socket.error,
so only catch that specific exception.
1 parent c79f3d0 commit 9f9b593

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/asyncore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def set_reuse_addr (self):
266266
socket.SOL_SOCKET, socket.SO_REUSEADDR,
267267
self.socket.getsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1
268268
)
269-
except:
269+
except socket.error:
270270
pass
271271

272272
# ==================================================

0 commit comments

Comments
 (0)