Commits

Robert Brewer committed c647e69

Fix for #1045 (CherryPy should support uninstantiated classes as controllers, and instantiate them on dispatching)

Comments (0)

Files changed (1)

cherrypy/_cpdispatch.py

 """
 
 import string
+import types
 
 import cherrypy
 
             controller = result.get('controller')
             controller = self.controllers.get(controller, controller)
             if controller:
+                if isinstance(controller, (type, types.ClassType)):
+                    controller = controller()
                 # Get config from the controller.
                 if hasattr(controller, "_cp_config"):
                     merge(controller._cp_config)