Skip to content

Commit

Permalink
Only pass parameters to api classes when they accept them
Browse files Browse the repository at this point in the history
  • Loading branch information
erwin-eiq committed Apr 13, 2022
1 parent 5add91d commit f9c6863
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opentaxii/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import binascii
import functools
import importlib
import inspect
import logging
import re
import sys
Expand Down Expand Up @@ -36,7 +37,7 @@ def initialize_api(api_config):
cls = import_class(class_name)
params = api_config.get("parameters", None)

if params:
if params and inspect.signature(cls).parameters:
instance = cls(**params)
else:
instance = cls()
Expand Down

0 comments on commit f9c6863

Please sign in to comment.