hgext3rd/evolve/compat.py
changeset 4745 854637e3d2d0
parent 4716 d587611d0c78
child 4746 724c67878d98
--- a/hgext3rd/evolve/compat.py	Thu Jul 11 14:31:32 2019 -0700
+++ b/hgext3rd/evolve/compat.py	Tue Jul 09 10:56:42 2019 -0700
@@ -7,6 +7,7 @@
 """
 
 import inspect
+import array
 
 from mercurial import (
     context,
@@ -15,6 +16,7 @@
     mdiff,
     obsolete,
     obsutil,
+    pycompat,
     repair,
     scmutil,
     util,
@@ -22,6 +24,13 @@
 )
 from mercurial.hgweb import hgweb_mod
 
+if pycompat.ispy3:
+    arraytobytes = array.array.tobytes
+    arrayfrombytes = array.array.frombytes
+else:
+    arraytobytes = array.array.tostring
+    arrayfrombytes = array.array.fromstring
+
 # hg < 4.6 compat (c8e2d6ed1f9e)
 try:
     from mercurial import logcmdutil