Robert Brewer avatar Robert Brewer committed c6c4468

Last few 3.2 tweaks

Comments (0)

Files changed (4)

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

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

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"]'

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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.