Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspect parameters from tornado handler method with coroutine #99

Closed
lordent opened this issue Nov 15, 2016 · 3 comments

Comments

@lordent
Copy link

commented Nov 15, 2016

When used @gen.coroutine or similar decorator on handler method

@gen.coroutine
def get(self, item_id):

inspect.getargspec function (tornado plugin) return decorated arguments, and then we got empty list

args = inspect.getargspec(method).args[1:]

And error like this, when used function spec.add_path

raise APISpecError('Path template is not specified')

It fixed If use more common function signature from inspect module,
For example

args = list(inspect.signature(method).parameters.keys())[1:]
@sloria

This comment has been minimized.

Copy link
Member

commented Nov 20, 2016

Thanks for reporting. I would certainly review a PR for this.

sloria added a commit that referenced this issue Apr 18, 2017

@sloria

This comment has been minimized.

Copy link
Member

commented Apr 18, 2017

This has been fixed.

@sloria sloria closed this Apr 18, 2017

sloria added a commit that referenced this issue Apr 18, 2017

@sloria

This comment has been minimized.

Copy link
Member

commented Apr 18, 2017

0.20.1 also fixes this is Python 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.