Commits

Robert Brewer committed df72edf

Allow expose to work (without alias) on platforms that don't have getframe.

Comments (0)

Files changed (1)

cherrypy/__init__.py

         return func
     
     import sys, types
-    parents = sys._getframe(1).f_locals
     if isinstance(func, (types.FunctionType, types.MethodType)):
         # expose is being called directly, before the method has been bound
+        parents = sys._getframe(1).f_locals
         return expose_(func)
     else:
         if alias is None:
             return func
         else:
             # expose is returning a decorator "@expose(alias=...)"
+            parents = sys._getframe(1).f_locals
             return expose_
 
 def url(path="", qs="", script_name=None, base=None, relative=False):