use isinstance for type check

This commit is contained in:
Jakub Trllo 2024-03-27 12:36:07 +01:00
parent 0c2a54c567
commit a817a0a4d2
2 changed files with 5 additions and 5 deletions

View file

@ -89,7 +89,7 @@ def update_tag(tag, data):
# set all data metadata to tag metadata
for _k, _v in data_mtd.items():
value = str(_v)
if type(_v) == dict:
if isinstance(_v, dict):
value = json.dumps(_v)
# set the value

View file

@ -856,10 +856,10 @@ def _format_tiles(
"""
# Math used requires integers for correct output - as such
# we ensure our inputs are correct.
assert type(tiles_x) is int, "tiles_x must be an integer"
assert type(tiles_y) is int, "tiles_y must be an integer"
assert type(width) is int, "width must be an integer"
assert type(height) is int, "height must be an integer"
assert isinstance(tiles_x, int), "tiles_x must be an integer"
assert isinstance(tiles_y, int), "tiles_y must be an integer"
assert isinstance(width, int), "width must be an integer"
assert isinstance(height, int), "height must be an integer"
out = {"JobInfo": {}, "PluginInfo": {}}
cfg = OrderedDict()