Permalink
Browse files

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

  • Loading branch information...
1 parent 1aa218b commit c2c8d4044e2c6345f6e8d0f8617755dec7cd55d5 @claudep claudep committed Sep 12, 2012
@@ -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'))
@@ -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 ###
@@ -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):

0 comments on commit c2c8d40

Please sign in to comment.