Commits

Robert Brewer committed 57acdab

Fix for the fix for #486 (hey, that rhymes!).

  • Participants
  • Parent commits b9223ca

Comments (0)

Files changed (1)

File cherrypy/_cputil.py

     
     if exc == (None, None, None):
         return ""
-    if hasattr(exc[1], "args"):
-        page_handler_str = ""
-        if len(exc[1].args) > 1:
-            page_handler = exc[1].args.pop()
+    
+    page_handler_str = ""
+    args = list(getattr(exc[1], "args", []))
+    if args:
+        if len(args) > 1:
+            page_handler = args.pop()
             page_handler_str = 'Page handler: %s\n' % repr(page_handler)
+            exc[1].args = tuple(args)
     return page_handler_str + "".join(traceback.format_exception(*exc))
 
 def bareError(extrabody=None):