Skip to content

Commit ae2748b

Browse files
committed
fix: Windows does not support async call
`in _make_subprocess_transport raise NotImplementedError` https://docs.python.org/3/library/asyncio-platforms.html
1 parent 08fe6aa commit ae2748b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jupyterlab_wakatime/handlers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from contextlib import suppress
33
import json
44
import os.path
5+
import platform
56
import shlex
7+
import subprocess
68
from typing import TypedDict
79

810
from jupyter_server.base.handlers import APIHandler
@@ -39,6 +41,11 @@ async def post(self):
3941
self.set_status(400)
4042
return self.finish()
4143
self.log.info("wakatime-cli " + shlex.join(cmd_args))
44+
45+
if platform.system() == "Windows":
46+
subprocess.call([WAKATIME_CLI, *cmd_args])
47+
return self.finish()
48+
4249
proc = await asyncio.create_subprocess_exec(
4350
WAKATIME_CLI,
4451
*cmd_args,

0 commit comments

Comments
 (0)