Skip to content

Commit 0a83f95

Browse files
committed
Require Python >= 3.5.3
Python 3.5.2's typing module is utterly broken which unfortunately results in runtime errors.
1 parent 89038c4 commit 0a83f95

File tree

11 files changed

+15
-40
lines changed

11 files changed

+15
-40
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ before_cache:
2222
language: python
2323
matrix:
2424
include:
25-
- python: "3.5"
25+
- python: "3.5.3"
2626
env:
2727
- EVENT_LOOP=asyncio
2828
- TIMEOUT=2.0
29-
- python: "3.5"
29+
- python: "3.5.3"
3030
env:
3131
- EVENT_LOOP=uvloop
3232
- TIMEOUT=2.0

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Changelog
44
`4.0.0`_ (2018-01-24)
55
---------------------
66

7-
**Important:** Make sure you're using Python >= 3.5.2 before upgrading.
7+
**Important:** Make sure you're using Python >= 3.5.3 before upgrading.
88

99
- Drop Python 3.4 support (major)
1010
- Deprecate the CLI options `-sc`, `--sslcert` and `-sk`, `--sslkey`. Use

examples/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import ssl # noqa
44
import sys
55
from typing import Any # noqa
6+
from typing import Coroutine # noqa
67
from typing import List # noqa
78
from typing import Optional
89

910
import logbook.more
1011

1112
import saltyrtc.server
12-
from saltyrtc.server.typing import Coroutine # noqa
1313
from saltyrtc.server.typing import ServerSecretPermanentKey # noqa
1414

1515

examples/restartable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
import ssl # noqa
55
import sys
66
from typing import Any # noqa
7+
from typing import Coroutine # noqa
78
from typing import List # noqa
89
from typing import Optional
910

1011
import logbook.more
1112

1213
import saltyrtc.server
13-
from saltyrtc.server.typing import Coroutine # noqa
1414
from saltyrtc.server.typing import ServerSecretPermanentKey # noqa
1515

1616

saltyrtc/server/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
This is a SaltyRTC server implementation for Python 3.5+ using
2+
This is a SaltyRTC server implementation for Python 3.5.3+ using
33
:mod:`asyncio`.
44
"""
55
import itertools

saltyrtc/server/bin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import signal
88
import stat
99
from typing import Any # noqa
10+
from typing import Coroutine # noqa
1011
from typing import List # noqa
1112
from typing import Optional # noqa
1213
from typing import Sequence # noqa
@@ -19,7 +20,6 @@
1920
server,
2021
util,
2122
)
22-
from .typing import Coroutine # noqa
2323
from .typing import ServerSecretPermanentKey # noqa
2424
from .typing import LogbookLevel
2525

saltyrtc/server/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import binascii
33
import io
44
import struct
5+
from typing import ClassVar # noqa
56
from typing import (
67
TYPE_CHECKING,
78
Any,
@@ -42,7 +43,6 @@
4243
MessageError,
4344
MessageFlowError,
4445
)
45-
from .typing import ClassVar # noqa
4646
from .typing import (
4747
ChosenSubProtocol,
4848
ClientCookie,

saltyrtc/server/protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import enum
33
import os
44
import struct
5+
# noinspection PyUnresolvedReferences
6+
from typing import Coroutine # noqa
57
from typing import Dict # noqa
68
from typing import (
79
Any,
@@ -47,8 +49,6 @@
4749
OutgoingMessageMixin,
4850
unpack,
4951
)
50-
# noinspection PyUnresolvedReferences
51-
from .typing import Coroutine # noqa
5252
from .typing import (
5353
ClientCookie,
5454
ClientPublicKey,

saltyrtc/server/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
import ssl
44
from collections import OrderedDict
55
from typing import Awaitable # noqa
6+
from typing import ClassVar # noqa
67
from typing import Dict # noqa
78
from typing import List # noqa
89
from typing import Set # noqa
910
from typing import (
1011
Any,
12+
Coroutine,
1113
Iterable,
1214
Mapping,
1315
Optional,
@@ -67,10 +69,8 @@
6769
Path,
6870
PathClient,
6971
)
70-
from .typing import ClassVar # noqa
7172
from .typing import (
7273
ChosenSubProtocol,
73-
Coroutine,
7474
DisconnectedData,
7575
EventCallback,
7676
EventData,

saltyrtc/server/typing.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from typing import (
32
TYPE_CHECKING,
43
Any,
@@ -24,8 +23,6 @@
2423
from .events import Event # noqa
2524

2625
__all__ = (
27-
'Coroutine',
28-
'ClassVar',
2926
'NoReturn',
3027
'ListOrTuple',
3128
'PathHex',
@@ -62,20 +59,6 @@
6259
# Important: Do not export!
6360
T = TypeVar('T') # Any type
6461

65-
# Coroutine
66-
try:
67-
from typing import Coroutine
68-
except ImportError:
69-
# noinspection PyUnresolvedReferences
70-
from typing_extensions import Coroutine # Python <= 3.5.2
71-
72-
# ClassVar
73-
try:
74-
from typing import ClassVar
75-
except ImportError:
76-
# noinspection PyUnresolvedReferences
77-
from typing_extensions import ClassVar # Python <= 3.5.2
78-
7962
# NoReturn
8063
try:
8164
from typing import NoReturn
@@ -87,12 +70,7 @@
8770
# -------
8871

8972
# List or Tuple
90-
py_version = sys.version_info[:3]
91-
if py_version > (3, 5, 2):
92-
ListOrTuple = Union[List[T], Tuple[T]]
93-
else:
94-
# Workaround for "Cannot subscript an existing Union" in Python 3.5.2
95-
ListOrTuple = List # type: ignore
73+
ListOrTuple = Union[List[T], Tuple[T]]
9674

9775

9876
# Common

0 commit comments

Comments
 (0)