()
| 234 | |
| 235 | # See ticket #9448. |
| 236 | def get_layer(): |
| 237 | # This DataSource object is not accessible outside this |
| 238 | # scope. However, a reference should still be kept alive |
| 239 | # on the `Layer` returned. |
| 240 | ds = DataSource(source.ds) |
| 241 | return ds[0] |
| 242 | |
| 243 | # Making sure we can call OGR routines on the Layer returned. |
| 244 | lyr = get_layer() |