Skip to content

Commit

Permalink
Python 3 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
doudz committed Feb 20, 2020
1 parent bf01d2e commit 4da6617
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rpc4django/rpcdispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,7 @@ def __init__(self, method, name=None, signature=None, docstring=None):
# If we're using Python 3, look for function annotations, but allow
# the signature parameter override them.

try:
args, varargs, keywords, defaults = inspect.getargspec(method)
# varargs = None
# varkw = None
# kwonlyargs = None
# kwonlydefaults = None
annotations = {}

except ValueError:
try: # Python 3
full_args = inspect.getfullargspec(method)
args = full_args.args
# varargs = full_args.varargs
Expand All @@ -127,6 +119,14 @@ def __init__(self, method, name=None, signature=None, docstring=None):
# kwonlydefaults = full_args.kwonlydefaults
annotations = full_args.annotations

except AttributeError: # Python 2
args, varargs, keywords, defaults = inspect.getargspec(method)
# varargs = None
# varkw = None
# kwonlyargs = None
# kwonlydefaults = None
annotations = {}

self.args = [arg
for arg in args
if arg not in ('self', 'request')]
Expand Down

0 comments on commit 4da6617

Please sign in to comment.