Skip to content
Merged
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
11 changes: 9 additions & 2 deletions umodbus/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@
"""
from __future__ import division
import struct
import inspect
import math

try:
from inspect import getfullargspec
except ImportError:
# inspect.getfullargspec was introduced in Python 3.4.
# Earlier versions have inspect.getargspec.
from inspect import getargspec as getfullargspec

try:
from functools import reduce
except ImportError:
Expand Down Expand Up @@ -126,7 +133,7 @@ def create_function_from_response_pdu(resp_pdu, req_pdu=None):
function = function_code_to_function_map[function_code]

if req_pdu is not None and \
'req_pdu' in inspect.getargspec(function.create_from_response_pdu).args: # NOQA
'req_pdu' in getfullargspec(function.create_from_response_pdu).args: # NOQA

return function.create_from_response_pdu(resp_pdu, req_pdu)

Expand Down