From 20c4509715429b6a4323bf038002c744de284b51 Mon Sep 17 00:00:00 2001 From: "Naelson Douglas C. Oliveira" Date: Mon, 18 Oct 2021 15:55:03 -0300 Subject: [PATCH] removed a pitfall where the code was using a default mutable argument (#1581) --- sflib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sflib.py b/sflib.py index 53d5726b16..42217034e6 100644 --- a/sflib.py +++ b/sflib.py @@ -2364,7 +2364,7 @@ def checkDnsWildcard(self, target: str) -> bool: return True - def googleIterate(self, searchString: str, opts: dict = {}) -> dict: + def googleIterate(self, searchString: str, opts: dict = None) -> dict: """Request search results from the Google API. Will return a dict: @@ -2384,7 +2384,8 @@ def googleIterate(self, searchString: str, opts: dict = {}) -> dict: Returns: dict: Search results as {"webSearchUrl": "URL", "urls": [results]} """ - + if opts is None: + opts = {} search_string = searchString.replace(" ", "%20") params = urllib.parse.urlencode({ "cx": opts["cse_id"],