Skip to content

Commit

Permalink
fixed deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-r committed Jul 1, 2019
1 parent 152b4f3 commit 5326211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions facebook_business/adobjects/abstractobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
)
from facebook_business.typechecker import TypeChecker

import collections
import collections.abc
import json

class AbstractObject(collections.MutableMapping):
class AbstractObject(collections.abc.MutableMapping):

"""
Represents an abstract object (may or may not have explicitly be a node of
Expand Down
8 changes: 4 additions & 4 deletions facebook_business/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import os
import json
import six
import collections
import collections.abc
import re

from facebook_business.adobjects.objectparser import ObjectParser
Expand Down Expand Up @@ -93,7 +93,7 @@ def is_success(self):

json_body = self.json()

if isinstance(json_body, collections.Mapping) and 'error' in json_body:
if isinstance(json_body, collections.abc.Mapping) and 'error' in json_body:
# Is a dictionary, has error in it
return False
elif bool(json_body):
Expand Down Expand Up @@ -877,8 +877,8 @@ def _top_level_param_json_encode(params):

for param, value in params.items():
if (
isinstance(value, (collections.Mapping, collections.Sequence,
collections.Set, bool))
isinstance(value, (collections.abc.Mapping, collections.abc.Sequence,
collections.abc.Set, bool))
and not isinstance(value, six.string_types)
):
params[param] = json.dumps(
Expand Down

0 comments on commit 5326211

Please sign in to comment.