Fixed shutdown/restart command not acting properly on some Linux and macOS operating system. #2941

This commit is contained in:
morpheus65535
2025-06-11 23:20:01 -04:00
parent cc5fa4200c
commit 3d57a1231c

View File

@@ -87,6 +87,12 @@ class Server:
self.server.run()
except (KeyboardInterrupt, SystemExit):
self.shutdown()
except OSError as error:
if error.errno == 9:
# deal with "OSError: [Errno 9] Bad file descriptor" by closing webserver again.
self.server.close()
else:
pass
except Exception:
pass