diff --git a/python/pyarrow/tests/test_flight.py b/python/pyarrow/tests/test_flight.py index 3fcac064876..082d2d86ecd 100644 --- a/python/pyarrow/tests/test_flight.py +++ b/python/pyarrow/tests/test_flight.py @@ -1118,7 +1118,7 @@ def test_client_wait_for_available(): server = None def serve(): - global server + nonlocal server time.sleep(0.5) server = FlightServerBase(location) server.serve() diff --git a/python/scripts/run_emscripten_tests.py b/python/scripts/run_emscripten_tests.py index 9b833525939..82846a65366 100644 --- a/python/scripts/run_emscripten_tests.py +++ b/python/scripts/run_emscripten_tests.py @@ -114,7 +114,7 @@ def end_headers(self): def run_server_thread(dist_dir, q): - global _SERVER_ADDRESS + global _SERVER_ADDRESS # type: ignore[unresolved-global] os.chdir(dist_dir) server = http.server.HTTPServer(("", 0), TemplateOverrider) q.put(server.server_address)