hgext/remotenames.py
changeset 36962 b710fdebd0db
parent 36927 32f9b7e3f056
child 37071 aa97e06a1912
--- a/hgext/remotenames.py	Mon Feb 26 20:44:21 2018 +0800
+++ b/hgext/remotenames.py	Tue Mar 13 17:55:03 2018 -0400
@@ -22,8 +22,6 @@
 
 from __future__ import absolute_import
 
-import collections
-
 from mercurial.i18n import _
 
 from mercurial.node import (
@@ -32,12 +30,20 @@
 from mercurial import (
     logexchange,
     namespaces,
+    pycompat,
     registrar,
     revsetlang,
     smartset,
     templateutil,
 )
 
+if pycompat.ispy3:
+    import collections.abc
+    mutablemapping = collections.abc.MutableMapping
+else:
+    import collections
+    mutablemapping = collections.MutableMapping
+
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
@@ -56,7 +62,7 @@
     default=True,
 )
 
-class lazyremotenamedict(collections.MutableMapping):
+class lazyremotenamedict(mutablemapping):
     """
     Read-only dict-like Class to lazily resolve remotename entries