Skip to content

Commit 364397c

Browse files
rootluluwbarnha
andauthored
[FIX] suitablt for the high vresion python. (#2394)
* [FIX] suitablt for the high vresion python. it won't import Mapping from collections at python3.11. tested it worked from python3.6 to 3.11.2. * Update selectors34.py to have conditional importing of Mapping from collections --------- Co-authored-by: William Barnhart <[email protected]>
1 parent a1d268a commit 364397c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kafka/vendor/selectors34.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
from __future__ import absolute_import
1616

1717
from abc import ABCMeta, abstractmethod
18-
from collections import namedtuple, Mapping
18+
from collections import namedtuple
19+
try:
20+
from collections.abc import Mapping
21+
except ImportError:
22+
from collections import Mapping
1923
from errno import EINTR
2024
import math
2125
import select

0 commit comments

Comments
 (0)