From dc12dfb85d1ffef966eea47328eda586c15dc89c Mon Sep 17 00:00:00 2001 From: chocolateboy Date: Mon, 26 Aug 2019 23:36:00 +0100 Subject: [PATCH] Fix deprecation warning > scraper.py:26: DeprecationWarning: > > Using or importing the ABCs from 'collections' instead of from > 'collections.abc' is deprecated, and in 3.8 it will stop working --- scraper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scraper.py b/scraper.py index 5b32fc5..75d6e36 100644 --- a/scraper.py +++ b/scraper.py @@ -2,7 +2,7 @@ import requests import sys -import collections +from collections.abc import MutableMapping import dataset from datetime import datetime @@ -23,7 +23,7 @@ def flatten(self, d, parent_key=''): items = [] for k, v in d.items(): new_key = parent_key + '_' + k if parent_key else k - if isinstance(v, collections.MutableMapping): + if isinstance(v, MutableMapping): items.extend(self.flatten(v, new_key).items()) else: new_key = new_key.replace('#', '')