Skip to content

Commit 05c1bd9

Browse files
committed
fix version comparison
1 parent 24a17aa commit 05c1bd9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/netCDF4/_netCDF4.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,7 @@ __version__ = "1.7.4.1"
12881288
# Initialize numpy
12891289
import posixpath
12901290
from cftime import date2num, num2date, date2index
1291+
from packaging.version import Version
12911292
import numpy
12921293
cimport numpy
12931294
import weakref
@@ -2410,7 +2411,7 @@ strings.
24102411

24112412
# flag to indicate that Variables in this Dataset support orthogonal indexing.
24122413
self.__orthogonal_indexing__ = True
2413-
if diskless and __netcdf4libversion__ < '4.2.1':
2414+
if diskless and Version(__netcdf4libversion__) < Version('4.2.1'):
24142415
#diskless = False # don't raise error, instead silently ignore
24152416
raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__)
24162417
# convert filename into string (from os.path object for example),

0 commit comments

Comments
 (0)