From f5c87c892272e60d114dafd074d3da970774904f Mon Sep 17 00:00:00 2001 From: Neyberson Date: Thu, 8 Aug 2024 15:35:03 -0500 Subject: [PATCH] Change json_command dictionary and add conditional to add params at send_command() --- devtools/session.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devtools/session.py b/devtools/session.py index c539dad2..3038c732 100644 --- a/devtools/session.py +++ b/devtools/session.py @@ -25,9 +25,11 @@ def send_command(self, command, params=None, cb=None): json_command = { "id": self.message_id, "method": command, - "params": params, } + if params: + json_command["params"] = params + if self.session_id != "": json_command["session_id"] = self.session_id