Skip to content

Commit a2a9d6a

Browse files
committed
[GR-35705] Add patch for charset_normalizer
PullRequest: graalpython/2069
2 parents 34fa4e5 + 9a86aba commit a2a9d6a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/charset_normalizer/utils.py b/charset_normalizer/utils.py
2+
index dcb14df..12079e3 100644
3+
--- a/charset_normalizer/utils.py
4+
+++ b/charset_normalizer/utils.py
5+
@@ -11,7 +11,10 @@ from functools import lru_cache
6+
from re import findall
7+
from typing import List, Optional, Set, Tuple, Union
8+
9+
-from _multibytecodec import MultibyteIncrementalDecoder # type: ignore
10+
+try:
11+
+ from _multibytecodec import MultibyteIncrementalDecoder # type: ignore
12+
+except ImportError:
13+
+ MultibyteIncrementalDecoder = None
14+
15+
from .constant import (
16+
ENCODING_MARKS,
17+
@@ -244,7 +247,7 @@ def is_multi_byte_encoding(name: str) -> bool:
18+
} or issubclass(
19+
importlib.import_module("encodings.{}".format(name)).IncrementalDecoder, # type: ignore
20+
MultibyteIncrementalDecoder,
21+
- )
22+
+ ) if MultibyteIncrementalDecoder else False
23+
24+
25+
def identify_sig_or_bom(sequence: bytes) -> Tuple[Optional[str], bytes]:
26+
--
27+
2.31.1
28+

0 commit comments

Comments
 (0)