Skip to content

Commit

Permalink
fix: async call workaround for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanChain committed Feb 6, 2024
1 parent 5629347 commit 95c5f66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jupyterlab_wakatime/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ async def post(self):
return self.finish()
self.log.info("wakatime-cli " + shlex.join(cmd_args))

# Async subprocess is required for non-blocking access to return code
# However, it's not supported on Windows
# As a workaround, create a Popen instance and leave it alone
if platform.system() == "Windows":
subprocess.call([WAKATIME_CLI, *cmd_args])
subprocess.Popen([WAKATIME_CLI, *cmd_args])
return self.finish()

proc = await asyncio.create_subprocess_exec(
Expand Down

0 comments on commit 95c5f66

Please sign in to comment.