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