Skip to content

Commit b05ce41

Browse files
committed
Fix for Windows
1 parent cb6da86 commit b05ce41

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

ptrlib/connection/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def __init__(self, sock: socket.socket, peer: AddressT | None = None, **kwargs):
4848
def __str__(self) -> str:
4949
try:
5050
return f"TCPConnection({self.remote_address})"
51-
except RuntimeError:
51+
except (RuntimeError, OSError):
52+
# OSError: Windows raises WinError 10038 on closed socket
5253
return "TCPConnection(<closed>)"
5354

5455
# ---- Properties ------------------------------------------------------

ptrlib/debugger/unix/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
from .debug import *
2-
from .process import *
1+
import os
2+
3+
if os.name != 'nt':
4+
from .debug import *
5+
from .process import *

0 commit comments

Comments
 (0)