Skip to content

Commit ee73e6c

Browse files
author
David Sternlicht
committed
Fix deprecation warning when using collection.MutableMapping
1 parent 08c8394 commit ee73e6c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

libtmux/_compat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
from string import lower as ascii_lowercase
3636
import urlparse
3737

38+
from collections import MutableMapping
39+
3840
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
3941

4042
def implements_to_string(cls):
@@ -78,6 +80,8 @@ def console_to_str(s):
7880

7981
implements_to_string = _identity
8082

83+
from collections.abc import MutableMapping
84+
8185
def console_to_str(s):
8286
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
8387
try:

libtmux/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from distutils.version import LooseVersion
1616

1717
from . import exc
18-
from ._compat import console_to_str, str_from_console
18+
from ._compat import console_to_str, str_from_console, MutableMapping
1919

2020
logger = logging.getLogger(__name__)
2121

@@ -231,9 +231,9 @@ def __init__(self, *args, **kwargs):
231231
logger.debug('self.stdout for %s: \n%s' % (' '.join(cmd), self.stdout))
232232

233233

234-
class TmuxMappingObject(collections.MutableMapping):
234+
class TmuxMappingObject(MutableMapping):
235235

236-
"""Base: :py:class:`collections.MutableMapping`.
236+
"""Base: :py:class:`MutableMapping`.
237237
238238
Convenience container. Base class for :class:`Pane`, :class:`Window`,
239239
:class:`Session` and :class:`Server`.

0 commit comments

Comments
 (0)