From 80a87aaaddaf8f3542e3ef9f11b080664223e482 Mon Sep 17 00:00:00 2001 From: soundmud Date: Mon, 6 Jul 2020 20:29:05 +0200 Subject: [PATCH] fixed: test_desync.py shouldn't require pywin32 --- test_desync.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test_desync.py b/test_desync.py index 89b23d92..87a10632 100644 --- a/test_desync.py +++ b/test_desync.py @@ -1,9 +1,13 @@ #! python3 +import sys from multiprocessing import Process import os import time -import win32gui +try: + import win32gui +except ModuleNotFoundError: + pass from soundrts import config config.mods = "crazymod9beta10" @@ -57,8 +61,9 @@ def run_client(n, auto): clientmain.connect_and_play(auto=auto) def run_server(): - hwnd = win32gui.GetForegroundWindow() - win32gui.MoveWindow(hwnd, 400, 0, 800, 800, True) + if "win32gui" in sys.modules: + hwnd = win32gui.GetForegroundWindow() + win32gui.MoveWindow(hwnd, 400, 0, 800, 800, True) servermain.start_server(parameters="no_metaserver")