Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.pyc
*.swp
*.egg
.idea/*
env/
.venv/
.eggs/
Expand Down
10 changes: 7 additions & 3 deletions src/falconpy/_util/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
from warnings import warn
from json import loads
try:
from simplejson import JSONDecodeError
except (ImportError, ModuleNotFoundError): # Support import as a module
from json.decoder import JSONDecodeError
from simplejson import JSONDecodeError as SimplejsonJSONDecodeError
except (ImportError, ModuleNotFoundError):
SimplejsonJSONDecodeError = None # Support import as a module
from json.decoder import JSONDecodeError as StdJSONDecodeError
from typing import Dict, Any, Union, Optional, List, TYPE_CHECKING
from copy import deepcopy
from logging import Logger
Expand Down Expand Up @@ -85,6 +86,9 @@

urllib3.disable_warnings(InsecureRequestWarning)

# create a tuple of all possible JSONDecodeError types for exception handling
JSONDecodeError = (SimplejsonJSONDecodeError, StdJSONDecodeError) if SimplejsonJSONDecodeError else (StdJSONDecodeError,)


def validate_payload(validator: Dict[str, Any],
payload: Dict[str, Union[str, int, dict, list, bytes]],
Expand Down