From 4b24d6e3e47ab04b724c7891fc14a8485c4d1b55 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 2 Jul 2019 20:48:43 +0300 Subject: [PATCH] Minor changes --- platformio/commands/home/rpc/handlers/piocore.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platformio/commands/home/rpc/handlers/piocore.py b/platformio/commands/home/rpc/handlers/piocore.py index 9df38461..b481afca 100644 --- a/platformio/commands/home/rpc/handlers/piocore.py +++ b/platformio/commands/home/rpc/handlers/piocore.py @@ -77,6 +77,7 @@ class PIOCoreRPC(object): @staticmethod def call(args, options=None): + PIOCoreRPC.setup_multithreading_std_streams() try: args = [ str(arg) if not isinstance(arg, string_types) else arg @@ -86,11 +87,8 @@ class PIOCoreRPC(object): raise jsonrpc.exceptions.JSONRPCDispatchException( code=4002, message="PIO Core: non-ASCII chars in arguments") - PIOCoreRPC.setup_multithreading_std_streams() - cwd = (options or {}).get("cwd") or os.getcwd() - def _call_inline(): - with util.cd(cwd): + with util.cd((options or {}).get("cwd") or os.getcwd()): exit_code = __main__.main(["-c"] + args) return (PIOCoreRPC.thread_stdout.get_value_and_close(), PIOCoreRPC.thread_stderr.get_value_and_close(), exit_code)