Skip to content

Commit f466ce1

Browse files
authored
Merge pull request #269 from stratakis/cython-3.1
Fix compatibility with Cython >= 3.1
2 parents 2a615a5 + 99790cf commit f466ce1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pygrib/_pygrib.pyx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ __version__ = '2.1.6'
55
import numpy as np
66
cimport numpy as npc
77
cimport cython
8-
from ctypes import c_long as long
98
import warnings
109
import os
1110
from datetime import datetime
@@ -423,7 +422,7 @@ cdef class open(object):
423422
grbs = [self.message(n) for n in xrange(beg,end,inc)]
424423
self.seek(msg) # put iterator back in original position
425424
return grbs
426-
elif type(key) == int or type(key) == long:
425+
elif type(key) == int:
427426
# for an integer, return a single grib message.
428427
msg = self.tell()
429428
grb = self.message(key)
@@ -1924,8 +1923,8 @@ Example usage:
19241923
# if there are no matches for this key, just skip it
19251924
if not size:
19261925
continue
1927-
if typ == 'l' or (type(v) == int or type(v) == long):
1928-
longval = long(v)
1926+
if typ == 'l' or (type(v) == int):
1927+
longval = int(v)
19291928
err = grib_index_select_long(self._gi, key, longval)
19301929
if err:
19311930
raise RuntimeError(_get_error_message(err))

0 commit comments

Comments
 (0)