Skip to content

Commit df0cdf1

Browse files
committed
Import ABC from collections.abc for Python 3 compatibility.
1 parent e3c963b commit df0cdf1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libtmux/_compat.py

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import ConfigParser as configparser
2727

2828
from itertools import izip, imap
29+
from collections import MutableMapping
2930

3031
range_type = xrange
3132

@@ -73,6 +74,7 @@ def console_to_str(s):
7374
import urllib.parse as urllib
7475
import urllib.parse as urlparse
7576
from urllib.request import urlretrieve
77+
from collections.abc import MutableMapping
7678

7779
console_encoding = sys.__stdout__.encoding
7880

libtmux/common.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
~~~~~~~~~~~~~~
77
88
"""
9-
import collections
109
import logging
1110
import os
1211
import re
@@ -15,7 +14,7 @@
1514
from distutils.version import LooseVersion
1615

1716
from . import exc
18-
from ._compat import console_to_str, str_from_console
17+
from ._compat import console_to_str, MutableMapping, str_from_console
1918

2019
logger = logging.getLogger(__name__)
2120

@@ -231,7 +230,7 @@ def __init__(self, *args, **kwargs):
231230
logger.debug('self.stdout for %s: \n%s' % (' '.join(cmd), self.stdout))
232231

233232

234-
class TmuxMappingObject(collections.MutableMapping):
233+
class TmuxMappingObject(MutableMapping):
235234

236235
r"""Base: :py:class:`collections.MutableMapping`.
237236

0 commit comments

Comments
 (0)