Skip to content

Commit

Permalink
netcdf_cf.py: remove use of 'imp' module removed in python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jul 7, 2023
1 parent dd84c0a commit 89bd69c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions autotest/gdrivers/netcdf_cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# DEALINGS IN THE SOFTWARE.
###############################################################################

import imp # for netcdf_cf_setup()
import importlib # for netcdf_cf_setup()
import os

from gdrivers.netcdf import netcdf_setup, netcdf_test_copy # noqa
Expand Down Expand Up @@ -64,10 +64,9 @@ def netcdf_cf_setup():

# try local method
cdms2_installed = False
try:
imp.find_module("cdms2")
if importlib.util.find_spec("cdms2"):
cdms2_installed = True
except ImportError:
else:
print("NOTICE: cdms2 not installed!")
print(" see installation notes at http://pypi.python.org/pypi/cfchecker")
if cdms2_installed:
Expand Down

0 comments on commit 89bd69c

Please sign in to comment.