From f6d62828b8a1162973c2162d783ee1d01e88296e Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Wed, 24 May 2017 19:25:27 +0200 Subject: [PATCH] Update pynma.py Correcting the following issue (https://github.com/Schrolli91/BOSWatch/issues/217) -Using type() instead of isinstance() for a typecheck. --- includes/pynma/pynma.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/pynma/pynma.py b/includes/pynma/pynma.py index ff91a31..08a71cb 100644 --- a/includes/pynma/pynma.py +++ b/includes/pynma/pynma.py @@ -39,16 +39,16 @@ takes 2 optional arguments: self._developerkey = None self.developerkey(developerkey) if apikey: - if type(apikey) == str: + if isinstance(apikey, str): apikey = [apikey] self._apikey = uniq(apikey) def addkey(self, key): "Add a key (register ?)" - if type(key) == str: + if isinstance(key, str): if not key in self._apikey: self._apikey.append(key) - elif type(key) == list: + elif isinstance(key, list): for k in key: if not k in self._apikey: self._apikey.append(k) @@ -65,7 +65,7 @@ takes 2 optional arguments: def developerkey(self, developerkey): "Sets the developer key (and check it has the good length)" - if type(developerkey) == str and len(developerkey) == 48: + if isinstance(developerkey, str) and len(developerkey) == 48: self._developerkey = developerkey def pushWithAPIKey(self, apikey=[], application="", event="", description="", url="", contenttype=None, priority=0, batch_mode=False, html=False):