Commits

Robert Brewer committed 01282dd

Fix for #1053 (types.ClassType gone in Python 3)

  • Participants
  • Parent commits 8cf389d

Comments (0)

Files changed (1)

cherrypy/_cpdispatch.py

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