Skip to content

Commit

Permalink
fix: replace deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
pppwaw committed May 24, 2024
1 parent 798cf6e commit 5fc066f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vodka/data/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ def __call__(self, fn):
def wrapped(*args, **kwargs):
resp = {"meta": {}, "data": self.data_type()}
try:
i_args = inspect.getargspec(fn)
if i_args.args and i_args.args[0] == "self":
fn(args[0], resp["data"], meta=resp["meta"], *args, **kwargs)
sig = inspect.signature(fn)
parameters = sig.parameters
if parameters and list(parameters.keys())[0] == "self":
fn(args[0], resp["data"], meta=resp["meta"], *args[1:], **kwargs)
else:
fn(resp["data"], meta=resp["meta"], *args, **kwargs)
except Exception as inst:
Expand Down

0 comments on commit 5fc066f

Please sign in to comment.