Fixed #36577 -- Removed obsolete try-except for GIS layermapping imports.
Some checks are pending
Docs / spelling (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Docs / lint-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run

This commit is contained in:
Adam Johnson 2025-08-27 10:57:08 +01:00 committed by nessita
parent 4f07767106
commit d8426f64a7

View file

@ -2,24 +2,16 @@
This module contains useful utilities for GeoDjango.
"""
from django.contrib.gis.utils.layermapping import LayerMapError, LayerMapping
from django.contrib.gis.utils.ogrinfo import ogrinfo
from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect
from django.contrib.gis.utils.srs import add_srs_entry
from django.core.exceptions import ImproperlyConfigured
__all__ = [
"add_srs_entry",
"mapping",
"ogrinfo",
"ogrinspect",
"LayerMapError",
"LayerMapping",
]
try:
# LayerMapping requires DJANGO_SETTINGS_MODULE to be set,
# and ImproperlyConfigured is raised if that's not the case.
from django.contrib.gis.utils.layermapping import LayerMapError, LayerMapping
__all__ += ["LayerMapError", "LayerMapping"]
except ImproperlyConfigured:
pass