Fix cross-platform errno compatibility

Co-authored-by: anjrew <26453863+anjrew@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-09 12:30:13 +00:00
parent 3f387756ab
commit 3e10e3e621

View File

@@ -1,5 +1,6 @@
import os
import socket
import errno
from ursina import * # type: ignore
from time import time
import cv2
@@ -91,7 +92,7 @@ class CommandServer:
self.server_socket.listen(5)
print("[Command Listener] Listening on port 9999...")
except OSError as e:
if e.errno == 48: # Address already in use
if e.errno == errno.EADDRINUSE: # Address already in use
print("\n" + "="*70)
print("ERROR: Port 9999 is already in use!")
print("="*70)