Commits

Robert Brewer  committed c6c4468

Last few 3.2 tweaks

  • Participants
  • Parent commits 8088b54

Comments (0)

Files changed (4)

File cherrypy/lib/httputil.py

     def __unicode__(self):
         return ntou(self.__str__())
     
-    
     def parse(elementstr):
         """Transform 'token;key=val' to ('token', {'key': 'val'})."""
         # Split the element into a value and parameters. The 'value' may

File cherrypy/test/test_conn.py

 
 import cherrypy
 from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, NotConnected, BadStatusLine
-from cherrypy._cpcompat import ntob, urlopen
+from cherrypy._cpcompat import ntob, urlopen, unicodestr
 from cherrypy.test import webtest
 from cherrypy import _cperror
 
                 body = [body]
             newbody = []
             for chunk in body:
-                if isinstance(chunk, unicode):
+                if isinstance(chunk, unicodestr):
                     chunk = chunk.encode('ISO-8859-1')
                 newbody.append(chunk)
             return newbody

File cherrypy/test/test_json.py

 
         root = Root()
         cherrypy.tree.mount(root)
-    setup_server = staticmethod(setup_server)
+    setup_server = staticmethod(setup_server)
     
     def test_json_output(self):
         if json is None:
-            self.skip("json not found ")
+            self.skip("json not found ")
             return
         
         self.getPage("/plain")
 
     def test_json_input(self):
         if json is None:
-            self.skip("json not found ")
+            self.skip("json not found ")
             return
         
         body = '[13, "c"]'

File cherrypy/test/test_xmlrpc.py

+import sys
 from xmlrpclib import DateTime, Fault, ServerProxy, SafeTransport
 
 class HTTPSTransport(SafeTransport):
         # Test an error in the page handler (should raise an xmlrpclib.Fault)
         try:
             proxy.test_argument_passing({})
-        except Exception, x:
+        except Exception:
+            x = sys.exc_info()[1]
             self.assertEqual(x.__class__, Fault)
             self.assertEqual(x.faultString, ("unsupported operand type(s) "
                                              "for *: 'dict' and 'int'"))
         # if a method is not found, an xmlrpclib.Fault should be raised
         try:
             proxy.non_method()
-        except Exception, x:
+        except Exception:
+            x = sys.exc_info()[1]
             self.assertEqual(x.__class__, Fault)
             self.assertEqual(x.faultString, 'method "non_method" is not supported')
         else:
         # Test returning a Fault from the page handler.
         try:
             proxy.test_returning_Fault()
-        except Exception, x:
+        except Exception:
+            x = sys.exc_info()[1]
             self.assertEqual(x.__class__, Fault)
             self.assertEqual(x.faultString, ("custom Fault response"))
         else: