Handle importing SupportsIndex in Python 3.6 and 3.7
This commit is contained in:
+6
-1
@@ -1,6 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher
|
||||||
from typing import Any, Dict, List, Tuple, Optional, Pattern, SupportsIndex, Union, Callable, Generator
|
from typing import Any, Dict, List, Tuple, Optional, Pattern, Union, Callable, Generator
|
||||||
|
try:
|
||||||
|
from typing import SupportsIndex
|
||||||
|
except ImportError:
|
||||||
|
# 'SupportsIndex' got added in Python 3.8
|
||||||
|
SupportsIndex = None
|
||||||
|
|
||||||
from scrapling.translator import HTMLTranslator
|
from scrapling.translator import HTMLTranslator
|
||||||
from scrapling.mixins import SelectorsGeneration
|
from scrapling.mixins import SelectorsGeneration
|
||||||
|
|||||||
Reference in New Issue
Block a user