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

expose and when decorators can't decorate non-function object decorators #47

Closed
kevinbenton opened this Issue Mar 15, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@kevinbenton
Copy link

kevinbenton commented Mar 15, 2016

If a decorator is used on a controller method that is just a normal object with a call method, it will not necessarily have the code attribute this line[1] is looking for so pecan will fail to load when using one of these style decorators. For an example of this type of decorator, check out the oslo DB wrap db retry decorator: https://github.com/malor/oslo.db/blob/b50609bc0e63704947c0e9d66e503155e885bc0d/oslo/db/api.py#L42

  1. key=lambda c: 'self' in c.cell_contents.__code__.co_varnames,
@ryanpetrello

This comment has been minimized.

Copy link
Member

ryanpetrello commented Mar 16, 2016

Closed via #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment