- don't let the user set something higher (- 50) than system allows
import logging
import json
+import sys
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
with open("config.json") as f:
logger.debug("Loading configuration file ...")
_config = json.loads(f.read())
+ _config["max_crawl_depth"] = min(_config["max_crawl_depth"], (sys.getrecursionlimit() - 50))
def get(key: str) -> any:
logger.debug("key[%s]='%s' - CALLED!", type(key), key)