Fix counting function arguments in Python 3

pull/1568/head
Matthew D. Scholefield 2018-04-27 11:42:54 -05:00
parent 57a9b0b8e1
commit 0abc3c78b1
1 changed files with 2 additions and 4 deletions

View File

@ -18,7 +18,7 @@ import sys
import time
import csv
import inspect
from inspect import getargspec
from inspect import getargspec, signature
from datetime import datetime, timedelta
import abc
@ -591,9 +591,7 @@ class MycroftSkill(object):
self.emitter.emit(Message(msg_type, skill_data))
with stopwatch:
is_bound = bool(getattr(handler, 'im_self', None))
num_args = len(getargspec(handler).args) - is_bound
if num_args == 0:
if len(signature(handler).parameters) == 0:
handler()
else:
handler(message)