Skip to content

Commit

Permalink
Fix some flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Aug 10, 2023
1 parent e81baf0 commit 2fd1bd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions QuickOSM/core/query_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def _check_parameters(self) -> bool:
:raise QueryFactoryException:
"""
if type(self._query_type) != QueryType:
if not isinstance(self._query_type, QueryType):
raise QueryFactoryException(tr('Wrong query type.'))

for osmObject in self._osm_objects:
if type(osmObject) != OsmType:
if not isinstance(osmObject, OsmType):
raise QueryFactoryException(tr('Wrong OSM object.'))

if self._query_type == QueryType.AroundArea:
Expand Down
4 changes: 2 additions & 2 deletions QuickOSM/core/utilities/json_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class EnumEncoder(json.JSONEncoder):
"""Override the json encoder to serialize enum."""
def default(self, obj):
"""Function of serialization."""
if type(obj) in [LayerType, Format, MultiType]:
if isinstance(obj, (LayerType, Format, MultiType)):
return {"__enum__": str(obj)}
if type(obj) == QgsRectangle:
if isinstance(obj, QgsRectangle):
extent = [
str(obj.xMinimum()), str(obj.yMinimum()),
str(obj.xMaximum()), str(obj.yMaximum())
Expand Down

0 comments on commit 2fd1bd1

Please sign in to comment.