Skip to content

Commit

Permalink
Merge pull request #272 from hugovk/fix-deprecation-warnings
Browse files Browse the repository at this point in the history
chore: Fix deprecation warnings
  • Loading branch information
rennerocha authored Sep 11, 2020
2 parents a430b34 + 0e8165e commit de1cd20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spidermon/contrib/scrapy/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from scrapy.utils.misc import load_object
from scrapy.exporters import JsonLinesItemExporter
from scrapy import Field, Item
from scrapy.utils.python import to_native_str
from scrapy.utils.python import to_unicode

from spidermon.contrib.validation import SchematicsValidator, JSONSchemaValidator
from spidermon.contrib.validation.jsonschema.tools import get_schema_from
Expand Down Expand Up @@ -141,7 +141,7 @@ def _convert_item_to_dict(self, item):
serialized_json = BytesIO()
exporter = JsonLinesItemExporter(serialized_json)
exporter.export_item(item)
data = json.loads(to_native_str(serialized_json.getvalue(), exporter.encoding))
data = json.loads(to_unicode(serialized_json.getvalue(), exporter.encoding))
serialized_json.close()
return data

Expand Down
2 changes: 1 addition & 1 deletion spidermon/contrib/stats/counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def inc_value(self, value):
self._count += value


class DictPercentCounter(PercentCounterBase, collections.MutableMapping):
class DictPercentCounter(PercentCounterBase, collections.abc.MutableMapping):
__items_class__ = PercentCounter

def __init__(self, total):
Expand Down

0 comments on commit de1cd20

Please sign in to comment.