Skip to content

Commit 2aa5ff7

Browse files
committed
inspect.getargspec() has been deprecated since Python 3.0
1 parent 61f8454 commit 2aa5ff7

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

cloudbot/hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def sieve(param=None, **kwargs):
309309
"""
310310

311311
def _sieve_hook(func):
312-
assert len(inspect.getargspec(func).args) == 3, \
312+
assert len(inspect.getfullargspec(func).args) == 3, \
313313
"Sieve plugin has incorrect argument count. Needs params: bot, input, plugin"
314314

315315
hook = _get_hook(func, "sieve")

cloudbot/plugin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,12 +640,10 @@ def __init__(self, _type, plugin, func_hook):
640640
self.function = func_hook.function
641641
self.function_name = self.function.__name__
642642

643-
self.required_args = inspect.getargspec(self.function)[0]
644-
if self.required_args is None:
645-
self.required_args = []
643+
sig = inspect.signature(self.function)
646644

647645
# don't process args starting with "_"
648-
self.required_args = [arg for arg in self.required_args if not arg.startswith("_")]
646+
self.required_args = [arg for arg in sig.parameters.keys() if not arg.startswith('_')]
649647

650648
if asyncio.iscoroutine(self.function) or asyncio.iscoroutinefunction(self.function):
651649
self.threaded = False

0 commit comments

Comments
 (0)