Skip to content

Commit

Permalink
Rephrase problematic Optional[Type[JSONEncoder]] (for Python < 3.5.3)
Browse files Browse the repository at this point in the history
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 <andersk@mit.edu>
  • Loading branch information
andersk authored and Pr0Ger committed Oct 8, 2019
1 parent 88ee900 commit a3c5b48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apns2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import typing
import weakref
from enum import Enum
from json import JSONEncoder
from threading import Thread
from typing import 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 @@ -50,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

0 comments on commit a3c5b48

Please sign in to comment.