From d6f9a82edb2859a9b64fc397d8d7dca5e53b7741 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Thu, 7 Jun 2018 18:51:52 -0700 Subject: [PATCH] Fix mutable default arguments --- plexpy/notifiers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 5d820bf9..6be78b49 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2442,7 +2442,8 @@ class PLEX(Notifier): else: return request.request_content(url) - def _sendjson(self, host, method, params={}): + def _sendjson(self, host, method, params=None): + params = params or {} data = [{'id': 0, 'jsonrpc': '2.0', 'method': method, 'params': params}] headers = {'Content-Type': 'application/json'} url = host + '/jsonrpc' @@ -3545,7 +3546,8 @@ class XBMC(Notifier): else: return request.request_content(url) - def _sendjson(self, host, method, params={}): + def _sendjson(self, host, method, params=None): + params = params or {} data = [{'id': 0, 'jsonrpc': '2.0', 'method': method, 'params': params}] headers = {'Content-Type': 'application/json'} url = host + '/jsonrpc'