You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In earlier versions of python you would have to use functools.wraps your original function and check if the callback has the attribute __wrapped__. This will only work for 1 level, if you do :
Ensures that the 'db' keyword parameter is correctly detected even when
other decorators are applied to the function. Fixesbottlepy#21 as discussed
there.
If you implement a decorator like:
The
valid_user()
plugin will throw an error likeWhich hides the fact that the check for the keyword
db
is failing, although, the callable does havethe keyword
db
.The reason the check fails, is because _callback is no longer the original function. this is solved in python3.3 with
In earlier versions of python you would have to use
functools.wraps
your original function and check if the callback has the attribute__wrapped__
. This will only work for 1 level, if you do :you would have to check for
callback.__wrapped__.__wrapped__
, or for each level of decoration add one__wrapped__
.The solution is to replace the check from:
To
The text was updated successfully, but these errors were encountered: