Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit c2c8d4044e2c6345f6e8d0f8617755dec7cd55d5 1 parent 1aa218b
@claudep claudep authored
View
2  django/contrib/gis/geos/libgeos.py
@@ -110,7 +110,7 @@ def geos_version_info():
is a release candidate (and what number release candidate), and the C API
version.
"""
- ver = geos_version()
+ ver = geos_version().decode()
m = version_regex.match(ver)
if not m: raise GEOSException('Could not parse version info string "%s"' % ver)
return dict((key, m.group(key)) for key in ('version', 'release_candidate', 'capi_version', 'major', 'minor', 'subminor'))
View
9 django/contrib/gis/geos/mutable_list.py
@@ -215,15 +215,18 @@ def reverse(self):
"Standard list reverse method"
self[:] = self[-1::-1]
- def sort(self, cmp=cmp, key=None, reverse=False):
+ def sort(self, cmp=None, key=None, reverse=False):
"Standard list sort method"
if key:
temp = [(key(v),v) for v in self]
- temp.sort(cmp=cmp, key=lambda x: x[0], reverse=reverse)
+ temp.sort(key=lambda x: x[0], reverse=reverse)
self[:] = [v[1] for v in temp]
else:
temp = list(self)
- temp.sort(cmp=cmp, reverse=reverse)
+ if cmp is not None:
+ temp.sort(cmp=cmp, reverse=reverse)
+ else:
+ temp.sort(reverse=reverse)
self[:] = temp
### Private routines ###
View
3  django/contrib/gis/geos/tests/__init__.py
@@ -16,7 +16,8 @@
def suite():
"Builds a test suite for the GEOS tests."
s = TestSuite()
- map(s.addTest, test_suites)
+ for suite in test_suites:
+ s.addTest(suite)
return s
def run(verbosity=1):
Please sign in to comment.
Something went wrong with that request. Please try again.