| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0b9332b commit 592c68c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -640,18 +640,22 @@ def _fallback_socketpair(family=AF_INET, type=SOCK_STREAM, proto=0): | |||
| 640 | 640 | # Authenticating avoids using a connection from something else | |
| 641 | 641 | # able to connect to {host}:{port} instead of us. | |
| 642 | 642 | # We expect only AF_INET and AF_INET6 families. | |
| 643 | - try: | ||
| 644 | - if ( | ||
| 645 | - ssock.getsockname() != csock.getpeername() | ||
| 646 | - or csock.getsockname() != ssock.getpeername() | ||
| 647 | - ): | ||
| 648 | - raise ConnectionError("Unexpected peer connection") | ||
| 649 | - except: | ||
| 650 | - # getsockname() and getpeername() can fail | ||
| 651 | - # if either socket isn't connected. | ||
| 652 | - ssock.close() | ||
| 653 | - csock.close() | ||
| 654 | - raise | ||
| 643 | + # | ||
| 644 | + # Note that we skip this on WASI because on that platorm the client socket | ||
| 645 | + # may not have finished connecting by the time we've reached this point (gh-146139). | ||
| 646 | + if sys.platform != "wasi": | ||
| 647 | + try: | ||
| 648 | + if ( | ||
| 649 | + ssock.getsockname() != csock.getpeername() | ||
| 650 | + or csock.getsockname() != ssock.getpeername() | ||
| 651 | + ): | ||
| 652 | + raise ConnectionError("Unexpected peer connection") | ||
| 653 | + except: | ||
| 654 | + # getsockname() and getpeername() can fail | ||
| 655 | + # if either socket isn't connected. | ||
| 656 | + ssock.close() | ||
| 657 | + csock.close() | ||
| 658 | + raise | ||
| 655 | 659 | ||
| 656 | 660 | return (ssock, csock) | |
| 657 | 661 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments