Skip to content

Commit

Permalink
Use func_code if __code__ is None.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees authored and pbauer committed May 2, 2017
1 parent 394e48b commit e95f96d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ZPublisher/mapply.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def mapply(object, positional=(), keyword={},
raise
code = f.__code__
defaults = f.__defaults__
if code is None:
# RestrictedPython / templates
code = f.func_code
defaults = f.func_defaults
names = code.co_varnames[count:code.co_argcount]

nargs = len(names)
Expand Down

0 comments on commit e95f96d

Please sign in to comment.