Skip to content

Commit

Permalink
r_out_legend (#1242)
Browse files Browse the repository at this point in the history
Replace the imp module with importlib.util
  • Loading branch information
ecodiv authored Nov 15, 2024
1 parent 327079d commit 0f57f2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/raster/r.out.legend/r.out.legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# DESCRIPTION: Export the legend of a raster as image, which can be used
# in e.g., the map composer in QGIS.
#
# COPYRIGHT: (C) 2014-2017 by Paulo van Breugel and the GRASS Development Team
# COPYRIGHT: (C) 2014-2024 by Paulo van Breugel and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
Expand Down Expand Up @@ -182,13 +182,13 @@
import grass.script as grass
from grass.pygrass.modules import Module
from grass.script.utils import parse_key_val
import imp
import importlib.util

try:
imp.find_module("PIL")
spec = importlib.util.find_spec("PIL")
if spec is not None:
found = True
from PIL import Image
except ImportError:
else:
found = False


Expand Down

0 comments on commit 0f57f2b

Please sign in to comment.