diff --git a/mssqlscripter/main.py b/mssqlscripter/main.py index 7bed0b5..bd3d1d2 100644 --- a/mssqlscripter/main.py +++ b/mssqlscripter/main.py @@ -105,7 +105,11 @@ def main(args): sql_tools_client.shutdown() tools_service_process.kill() # 1 second time out, allow tools service process to be killed. - time.sleep(1) + time.sleep(.1) + # Close the stdout file handle or else we would get a resource warning (found via pytest). + # This must be closed after the process is killed, otherwise we would block because the process is using + # it's stdout. + tools_service_process.stdout.close() # None value indicates process has not terminated. if not tools_service_process.poll(): sys.stderr.write(