Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Fixing resource warning for sqltoolsservice #158

Merged
merged 2 commits into from
Oct 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mssqlscripter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down