Skip to content

Commit

Permalink
v.in.pygbif: lazy import of 'osgeo' module (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Dec 20, 2020
1 parent 6fdf502 commit 619f9f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions grass7/vector/v.in.pygbif/v.in.pygbif.py
Expand Up @@ -182,8 +182,6 @@

# import os
import math
from osgeo import ogr, osr
from osgeo import __version__ as gdal_version
import grass.script as grass
from grass.pygrass.vector import Vector
from grass.pygrass.vector import VectorTopo
Expand Down Expand Up @@ -832,5 +830,13 @@ def main():

# Run the module
if __name__ == "__main__":
try:
from osgeo import ogr, osr
from osgeo import __version__ as gdal_version
except ImportError:
grass.fatal(_("Unable to load GDAL Python bindings (requires "
"package 'python-gdal' or Python library GDAL "
"to be installed)."))

options, flags = grass.parser()
sys.exit(main())

0 comments on commit 619f9f9

Please sign in to comment.