try importing protocol from typing, fallback to typing_extensions
Browse files- pytube/monostate.py +5 -1
pytube/monostate.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
import io
|
2 |
from typing import Any, Optional
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# from __future__ import annotations
|
6 |
|
|
|
1 |
import io
|
2 |
from typing import Any, Optional
|
3 |
+
|
4 |
+
try:
|
5 |
+
from typing import Protocol
|
6 |
+
except ImportError:
|
7 |
+
from typing_extensions import Protocol
|
8 |
|
9 |
# from __future__ import annotations
|
10 |
|