Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made minimal changes to make gis test suite start with Python 3

  • Loading branch information...
commit c2c8d4044e2c6345f6e8d0f8617755dec7cd55d5 1 parent 1aa218b
Claude Paroz authored September 12, 2012
2  django/contrib/gis/geos/libgeos.py
@@ -110,7 +110,7 @@ def geos_version_info():
110 110
     is a release candidate (and what number release candidate), and the C API
111 111
     version.
112 112
     """
113  
-    ver = geos_version()
  113
+    ver = geos_version().decode()
114 114
     m = version_regex.match(ver)
115 115
     if not m: raise GEOSException('Could not parse version info string "%s"' % ver)
116 116
     return dict((key, m.group(key)) for key in ('version', 'release_candidate', 'capi_version', 'major', 'minor', 'subminor'))
9  django/contrib/gis/geos/mutable_list.py
@@ -215,15 +215,18 @@ def reverse(self):
215 215
         "Standard list reverse method"
216 216
         self[:] = self[-1::-1]
217 217
 
218  
-    def sort(self, cmp=cmp, key=None, reverse=False):
  218
+    def sort(self, cmp=None, key=None, reverse=False):
219 219
         "Standard list sort method"
220 220
         if key:
221 221
             temp = [(key(v),v) for v in self]
222  
-            temp.sort(cmp=cmp, key=lambda x: x[0], reverse=reverse)
  222
+            temp.sort(key=lambda x: x[0], reverse=reverse)
223 223
             self[:] = [v[1] for v in temp]
224 224
         else:
225 225
             temp = list(self)
226  
-            temp.sort(cmp=cmp, reverse=reverse)
  226
+            if cmp is not None:
  227
+                temp.sort(cmp=cmp, reverse=reverse)
  228
+            else:
  229
+                temp.sort(reverse=reverse)
227 230
             self[:] = temp
228 231
 
229 232
     ### Private routines ###
3  django/contrib/gis/geos/tests/__init__.py
@@ -16,7 +16,8 @@
16 16
 def suite():
17 17
     "Builds a test suite for the GEOS tests."
18 18
     s = TestSuite()
19  
-    map(s.addTest, test_suites)
  19
+    for suite in test_suites:
  20
+        s.addTest(suite)
20 21
     return s
21 22
 
22 23
 def run(verbosity=1):

0 notes on commit c2c8d40

Please sign in to comment.
Something went wrong with that request. Please try again.