Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import ABC from collections.abc for Python 3.10 compatibility. #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions urbanairship/push/payload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# coding=utf-8
import collections
import collections.abc
import re
import warnings
from typing import List, Dict, Optional, Any, Union
Expand Down Expand Up @@ -993,7 +993,7 @@ def campaigns(categories: Union[Dict, List, None] = None) -> Dict[str, Any]:
"""
payload: Dict[str, Any] = {}
if categories is not None:
if not isinstance(categories, collections.Sequence):
if not isinstance(categories, collections.abc.Sequence):
raise TypeError("Each category must be a string")
if isinstance(categories, list):
if not categories or len(categories) > 10:
Expand Down Expand Up @@ -1039,13 +1039,13 @@ def actions(
"""
payload: Dict[str, Any] = {}
if add_tag is not None:
if not (isinstance(add_tag, (collections.Sequence))):
if not (isinstance(add_tag, (collections.abc.Sequence))):
raise TypeError("add_tag must be a string or a list of strings")
if isinstance(add_tag, list) and not add_tag:
raise ValueError("add_tag list cannot be empty")
payload["add_tag"] = add_tag
if remove_tag is not None:
if not (isinstance(remove_tag, (collections.Sequence))):
if not (isinstance(remove_tag, (collections.abc.Sequence))):
raise TypeError("remove_tag must be a string or a list of strings")
if isinstance(remove_tag, list) and not remove_tag:
raise ValueError("remove_tag list cannot be empty")
Expand Down