Skip to content

Commit

Permalink
python: import ABCs from collections.abc
Browse files Browse the repository at this point in the history
Importing Abstract Base Classes (ABCs) from the collections module
is deprecated since Python 3.3, it emits a warning since Python 3.8,
and it will stop working in Python 3.10.

Try importing MutableMapping from collections.abc (the preferred way since
Python 3.3) and, in case of error (Python < 3.3) fall back to importing it
from collections.
  • Loading branch information
lorenzosaino authored and yonghong-song committed Oct 23, 2020
1 parent 4967a61 commit 48946d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/python/bcc/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
# limitations under the License.

from __future__ import print_function
from collections import MutableMapping
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
import ctypes as ct
from functools import reduce
import multiprocessing
Expand Down

0 comments on commit 48946d2

Please sign in to comment.