Skip to content

Commit

Permalink
Satisfy flake8 linter
Browse files Browse the repository at this point in the history
This is the finding that is being addressed:
E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
  • Loading branch information
dav3r committed Nov 9, 2023
1 parent 7101643 commit d41517e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aws_jobs/cyhy-data-extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def custom_json_handler(obj):
"""Format a provided JSON object."""
if hasattr(obj, "isoformat"):
return obj.isoformat()
elif type(obj) == bson.objectid.ObjectId:
elif isinstance(obj, bson.objectid.ObjectId):
return repr(obj)
elif type(obj) == netaddr.IPAddress:
elif isinstance(obj, netaddr.IPAddress):
return str(obj)
elif type(obj) == netaddr.IPNetwork:
elif isinstance(obj, netaddr.IPNetwork):
return str(obj)
elif type(obj) == netaddr.IPSet:
elif isinstance(obj, netaddr.IPSet):
return obj.iter_cidrs()
else:
raise TypeError(
Expand Down

0 comments on commit d41517e

Please sign in to comment.