1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +00:00

gis: gdal: Made error message when opening an invalid DataSource more clear.

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-06-04 17:24:08 +00:00
parent 462d731423
commit acfc49ed4e

View File

@ -72,9 +72,13 @@ class DataSource(object):
if isinstance(ds_input, basestring):
# The data source driver is a void pointer.
ds_driver = c_void_p()
try:
# OGROpen will auto-detect the data source type.
ds = open_ds(ds_input, self._write, byref(ds_driver))
except OGRException:
# Making the error message more clear rather than something
# like "Invalid pointer returned from OGROpen".
raise OGRException('Could not open the datasource at "%s"' % ds_input)
elif isinstance(ds_input, c_void_p) and isinstance(ds_driver, c_void_p):
ds = ds_input
else: