Skip to content

Commit ab5e77b

Browse files
committed
Ruff linter: E721 Do not compare types, use isinstance()
1 parent 9f9d8fd commit ab5e77b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gribapi/errors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class GribInternalError(Exception):
2626
def __init__(self, value):
2727
# Call the base class constructor with the parameters it needs
2828
Exception.__init__(self, value)
29-
if type(value) is int:
29+
if isinstance(value, int):
3030
self.msg = ffi.string(lib.grib_get_error_message(value)).decode(ENC)
3131
else:
3232
self.msg = value

tests/test_eccodes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ def test_codes_set_samples_path():
5858

5959
def test_api_version():
6060
vs = eccodes.codes_get_api_version()
61-
assert type(vs) is str
61+
assert isinstance(vs, str)
6262
assert len(vs) > 0
6363
assert vs == eccodes.codes_get_api_version(str)
6464
vi = eccodes.codes_get_api_version(int)
65-
assert type(vi) is int
65+
assert isinstance(vi, int)
6666
assert vi > 20000
6767
print(vi)
6868

0 commit comments

Comments
 (0)