diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py index a4f5adf4d0d..aed6cf366ce 100644 --- a/django/contrib/gis/geos/libgeos.py +++ b/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')) diff --git a/django/contrib/gis/geos/mutable_list.py b/django/contrib/gis/geos/mutable_list.py index 69e50e6b3fb..820cdfa5a47 100644 --- a/django/contrib/gis/geos/mutable_list.py +++ b/django/contrib/gis/geos/mutable_list.py @@ -215,15 +215,18 @@ class ListMixin(object): "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 ### diff --git a/django/contrib/gis/geos/tests/__init__.py b/django/contrib/gis/geos/tests/__init__.py index ccf960c68f4..6b715d8c597 100644 --- a/django/contrib/gis/geos/tests/__init__.py +++ b/django/contrib/gis/geos/tests/__init__.py @@ -16,7 +16,8 @@ test_suites = [ 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):