From 3e10e3e62199def569ff3209674e93e9e8d26123 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 9 Nov 2025 12:30:13 +0000 Subject: [PATCH] Fix cross-platform errno compatibility Co-authored-by: anjrew <26453863+anjrew@users.noreply.github.com> --- tello_sim/command_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tello_sim/command_server.py b/tello_sim/command_server.py index d7ecadb..cda05a7 100644 --- a/tello_sim/command_server.py +++ b/tello_sim/command_server.py @@ -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)