mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #28569 -- Corrected get_layer_by_name prototype to skip error checking.
All other get_*_by_name functions have errcheck=False. This makes it return None for an invalid name instead of raising a GDALException.
This commit is contained in:
parent
c9b22707b0
commit
0d9e1163e8
@ -28,7 +28,7 @@ destroy_ds = void_output(lgdal.OGR_DS_Destroy, [c_void_p], errcheck=False)
|
|||||||
release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p])
|
release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p])
|
||||||
get_ds_name = const_string_output(lgdal.OGR_DS_GetName, [c_void_p])
|
get_ds_name = const_string_output(lgdal.OGR_DS_GetName, [c_void_p])
|
||||||
get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int])
|
get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int])
|
||||||
get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p])
|
get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p], errcheck=False)
|
||||||
get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p])
|
get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p])
|
||||||
|
|
||||||
# Layer Routines
|
# Layer Routines
|
||||||
|
@ -86,6 +86,9 @@ class DataSourceTest(unittest.TestCase):
|
|||||||
with self.assertRaises(IndexError):
|
with self.assertRaises(IndexError):
|
||||||
ds[len(ds)]
|
ds[len(ds)]
|
||||||
|
|
||||||
|
with self.assertRaises(IndexError):
|
||||||
|
ds['invalid']
|
||||||
|
|
||||||
def test02_invalid_shp(self):
|
def test02_invalid_shp(self):
|
||||||
"Testing invalid SHP files for the Data Source."
|
"Testing invalid SHP files for the Data Source."
|
||||||
for source in bad_ds:
|
for source in bad_ds:
|
||||||
|
Loading…
Reference in New Issue
Block a user