Robert Brewer committed 6fbc4c3

A couple of Python2.3 fixes.

Comments (0)

Files changed (2)


         items = [(self._priorities[(channel, listener)], listener)
                  for listener in self.listeners[channel]]
-        by_priority = lambda item: item[0]
-        items.sort(key=by_priority)
+        try:
+            items.sort(key=lambda item: item[0])
+        except TypeError:
+            # Python 2.3 had no 'key' arg, but that doesn't matter
+            # since it could sort dissimilar types just fine.
+            items.sort()
         for priority, listener in items:
                 output.append(listener(*args, **kwargs))


                     self._method = method
                     if not url:
-                        url = b'/'
-                    request = b' '.join((method.encode("ASCII"), url,
-                                         self._http_vsn_str.encode("ASCII")))
+                        url = ntob('/')
+                    request = ntob(' ').join((method.encode("ASCII"), url,
+                                              self._http_vsn_str.encode("ASCII")))
                 import types
                 conn.putrequest = types.MethodType(putrequest, conn)
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
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.