Skip to content

Commit a3c5b48

Browse files
anderskPr0Ger
authored andcommitted
Rephrase problematic Optional[Type[JSONEncoder]] (for Python < 3.5.3)
On Ubuntu 16.04, which has Python 3.5.2, this raised `TypeError: descriptor '__subclasses__' of 'type' object needs an argument` (python/typing#266). Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 88ee900 commit a3c5b48

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apns2/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import typing
66
import weakref
77
from enum import Enum
8-
from json import JSONEncoder
98
from threading import Thread
10-
from typing import Dict, Iterable, Optional, Tuple, Type, Union
9+
from typing import Dict, Iterable, Optional, Tuple, Union
1110

1211
from .credentials import CertificateCredentials, Credentials
1312
from .errors import ConnectionFailed, exception_class_for_reason
@@ -50,7 +49,7 @@ class APNsClient(object):
5049
def __init__(self,
5150
credentials: Union[Credentials, str],
5251
use_sandbox: bool = False, use_alternative_port: bool = False, proto: Optional[str] = None,
53-
json_encoder: Optional[Type[JSONEncoder]] = None, password: Optional[str] = None,
52+
json_encoder: Optional[type] = None, password: Optional[str] = None,
5453
proxy_host: Optional[str] = None, proxy_port: Optional[int] = None,
5554
heartbeat_period: Optional[float] = None) -> None:
5655
if isinstance(credentials, str):

0 commit comments

Comments
 (0)