mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
gis: gdal: Fixed Driver and DataSource bug reported by David Hancock in django-users and reproduced by tlp.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7003 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1d5e689af2
commit
298074d5b8
@ -67,8 +67,7 @@ class DataSource(object):
|
|||||||
|
|
||||||
# Registering all the drivers, this needs to be done
|
# Registering all the drivers, this needs to be done
|
||||||
# _before_ we try to open up a data source.
|
# _before_ we try to open up a data source.
|
||||||
if not get_driver_count() and not register_all():
|
if not get_driver_count(): register_all()
|
||||||
raise OGRException('Could not register all the OGR data source drivers!')
|
|
||||||
|
|
||||||
if isinstance(ds_input, basestring):
|
if isinstance(ds_input, basestring):
|
||||||
# The data source driver is a void pointer.
|
# The data source driver is a void pointer.
|
||||||
|
@ -56,9 +56,8 @@ class Driver(object):
|
|||||||
def _register(self):
|
def _register(self):
|
||||||
"Attempts to register all the data source drivers."
|
"Attempts to register all the data source drivers."
|
||||||
# Only register all if the driver count is 0 (or else all drivers
|
# Only register all if the driver count is 0 (or else all drivers
|
||||||
# will be registered over and over again)
|
# will be registered over and over again)
|
||||||
if not self.driver_count and not register_all():
|
if not self.driver_count: register_all()
|
||||||
raise OGRException('Could not register all the OGR data source drivers!')
|
|
||||||
|
|
||||||
# Driver properties
|
# Driver properties
|
||||||
@property
|
@property
|
||||||
|
@ -103,6 +103,9 @@ def void_output(func, argtypes, errcheck=True):
|
|||||||
# return void, rather than a status code.
|
# return void, rather than a status code.
|
||||||
func.restype = c_int
|
func.restype = c_int
|
||||||
func.errcheck = check_errcode
|
func.errcheck = check_errcode
|
||||||
|
else:
|
||||||
|
func.restype = None
|
||||||
|
|
||||||
return func
|
return func
|
||||||
|
|
||||||
def voidptr_output(func, argtypes):
|
def voidptr_output(func, argtypes):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user