Skip to content

Commit

Permalink
Fix a namespace warning when importing gdal directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 8, 2021
1 parent d593f4a commit 7307e70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pywps/dependencies.py
Expand Up @@ -6,6 +6,7 @@
import warnings

try:
import osgeo
from osgeo import gdal, ogr
except ImportError:
warnings.warn('Complex validation requires GDAL/OGR support.')
Expand Down
4 changes: 2 additions & 2 deletions pywps/validator/complexvalidator.py
Expand Up @@ -367,8 +367,8 @@ def validategeotiff(data_input, mode):
if mode >= MODE.STRICT:

try:
from pywps.dependencies import gdal
data_source = gdal.Open(data_input.file)
from pywps.dependencies import osgeo # noqa
data_source = osgeo.gdal.Open(data_input.file)
passed = (data_source.GetDriver().ShortName == "GTiff")
except ImportError:
passed = False
Expand Down

0 comments on commit 7307e70

Please sign in to comment.