fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect.
diff --git a/Misc/NEWS b/Misc/NEWS
index 1994d38..b39c1d6 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,10 @@
 Library
 -------
 
+- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on
+  OSX; avoid to call handle_connect in case of a disconnected socket which
+  was not meant to connect.
+
 - Issue #12757: Fix the skipping of doctests when python is run with -OO so
   that it works in unittest's verbose mode as well as non-verbose mode.