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

Fix importing in Python 3.5.2 #90

Merged
merged 2 commits into from
Oct 8, 2019
Merged
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 apns2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import logging
import time
import typing
import weakref
from enum import Enum
from json import JSONEncoder
from threading import Thread
from typing import Deque, Dict, Iterable, Optional, Tuple, Type, Union
from typing import Dict, Iterable, Optional, Tuple, Union

from .credentials import CertificateCredentials, Credentials
from .errors import ConnectionFailed, exception_class_for_reason
Expand Down Expand Up @@ -49,7 +49,7 @@ class APNsClient(object):
def __init__(self,
credentials: Union[Credentials, str],
use_sandbox: bool = False, use_alternative_port: bool = False, proto: Optional[str] = None,
json_encoder: Optional[Type[JSONEncoder]] = None, password: Optional[str] = None,
json_encoder: Optional[type] = None, password: Optional[str] = None,
proxy_host: Optional[str] = None, proxy_port: Optional[int] = None,
heartbeat_period: Optional[float] = None) -> None:
if isinstance(credentials, str):
Expand Down Expand Up @@ -185,7 +185,7 @@ def send_notification_batch(self, notifications: Iterable[Notification], topic:
self.connect()

results = {}
open_streams = collections.deque() # type: Deque[RequestStream]
open_streams = collections.deque() # type: typing.Deque[RequestStream]
# Loop on the tokens, sending as many requests as possible concurrently to APNs.
# When reaching the maximum concurrent streams limit, wait for a response before sending
# another request.
Expand Down