Skip to content

Commit

Permalink
Use getattr default sensibly
Browse files Browse the repository at this point in the history
  • Loading branch information
hfaran committed Mar 5, 2015
1 parent 71803c9 commit 7ecdc88
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tornado_json/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ def yield_args(module, cls_name, method_name):
method = extract_method(wrapped_method)

# If using tornado_json.gen.coroutine, original args are annotated...
argspec_args = getattr(method, "__argspec_args", None)
# otherwise just grab them from the method
if argspec_args is None:
argspec_args = inspect.getargspec(method).args
argspec_args = getattr(method, "__argspec_args",
# otherwise just grab them from the method
inspect.getargspec(method).args)

return [a for a in argspec_args if a not in ["self"]]

Expand Down

0 comments on commit 7ecdc88

Please sign in to comment.