### Eclipse Workspace Patch 1.0
#P django-trunk
|
|
|
399 | 399 | |
400 | 400 | return placeholder |
401 | 401 | |
402 | | def _get_postgis_func(self, func): |
| 402 | def _get_postgis_func(self, func, close=True): |
403 | 403 | """ |
404 | 404 | Helper routine for calling PostGIS functions and returning their result. |
405 | 405 | """ |
… |
… |
|
413 | 413 | raise |
414 | 414 | finally: |
415 | 415 | # Close out the connection. See #9437. |
416 | | self.connection.close() |
| 416 | if close: |
| 417 | self.connection.close() |
417 | 418 | return row[0] |
418 | 419 | |
419 | 420 | def postgis_geos_version(self): |
420 | 421 | "Returns the version of the GEOS library used with PostGIS." |
421 | 422 | return self._get_postgis_func('postgis_geos_version') |
422 | 423 | |
423 | | def postgis_lib_version(self): |
| 424 | def postgis_lib_version(self, close=True): |
424 | 425 | "Returns the version number of the PostGIS library used with PostgreSQL." |
425 | | return self._get_postgis_func('postgis_lib_version') |
| 426 | return self._get_postgis_func('postgis_lib_version', close) |
426 | 427 | |
427 | 428 | def postgis_proj_version(self): |
428 | 429 | "Returns the version of the PROJ.4 library used with PostGIS." |
… |
… |
|
436 | 437 | "Returns PostGIS version number and compile-time options." |
437 | 438 | return self._get_postgis_func('postgis_full_version') |
438 | 439 | |
439 | | def postgis_version_tuple(self): |
| 440 | def postgis_version_tuple(self, close=True): |
440 | 441 | """ |
441 | 442 | Returns the PostGIS version as a tuple (version string, major, |
442 | 443 | minor, subminor). |
443 | 444 | """ |
444 | 445 | # Getting the PostGIS version |
445 | | version = self.postgis_lib_version() |
| 446 | version = self.postgis_lib_version(close) |
446 | 447 | m = self.version_regex.match(version) |
447 | 448 | |
448 | 449 | if m: |