summaryrefslogtreecommitdiff
path: root/pecan/core.py
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2015-02-02 16:06:52 +0100
committerRyan Petrello <lists@ryanpetrello.com>2015-03-02 20:43:45 -0500
commita98e5f4547a1403a1242a5a498cb9ae2eefaf46e (patch)
treeda5bf11a3df58a0203094676f5c8564b714cacbd /pecan/core.py
parentf4d923dca610da1ee208f403afdb63b1e69f0657 (diff)
downloadpecan-a98e5f4547a1403a1242a5a498cb9ae2eefaf46e.tar.gz
core: do not assume controller is a method
If a controller is not a method (e.g. a staticmethod or a function), there's no need to pop up the self argument. That actually make the signature to mismatch, so let's fix that. Change-Id: Ia96b7d19b2b664381e422b7182d0437b841914dd
Diffstat (limited to 'pecan/core.py')
-rw-r--r--pecan/core.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pecan/core.py b/pecan/core.py
index 1c1da68..ad32525 100644
--- a/pecan/core.py
+++ b/pecan/core.py
@@ -343,7 +343,9 @@ class PecanBase(object):
args = []
varargs = []
kwargs = dict()
- valid_args = argspec.args[1:] # pop off `self`
+ valid_args = argspec.args[:]
+ if ismethod(state.controller) or im_self:
+ valid_args.pop(0) # pop off `self`
pecan_state = state.request.pecan
def _decode(x):