python3: add raw prefix to all array.array() calls
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 06 Aug 2019 11:30:45 +0200
changeset 4806 44629ae21b84
parent 4805 60e8cdce0e9c
child 4807 ea8da5aa23c6
python3: add raw prefix to all array.array() calls
hgext3rd/evolve/depthcache.py
hgext3rd/evolve/firstmergecache.py
hgext3rd/evolve/stablesort.py
--- a/hgext3rd/evolve/depthcache.py	Tue Aug 06 11:29:35 2019 +0200
+++ b/hgext3rd/evolve/depthcache.py	Tue Aug 06 11:30:45 2019 +0200
@@ -99,7 +99,7 @@
 
     def __init__(self):
         super(depthcache, self).__init__()
-        self._data = array.array('l')
+        self._data = array.array(r'l')
 
     def get(self, rev):
         if len(self._data) <= rev:
@@ -171,7 +171,7 @@
         Subclasses MUST overide this method to actually affect the cache data.
         """
         super(depthcache, self).clear()
-        self._data = array.array('l')
+        self._data = array.array(r'l')
 
     # crude version of a cache, to show the kind of information we have to store
 
@@ -180,7 +180,7 @@
         assert repo.filtername is None
 
         data = repo.cachevfs.tryread(self._filepath)
-        self._data = array.array('l')
+        self._data = array.array(r'l')
         if not data:
             self._cachekey = self.emptykey
         else:
--- a/hgext3rd/evolve/firstmergecache.py	Tue Aug 06 11:29:35 2019 +0200
+++ b/hgext3rd/evolve/firstmergecache.py	Tue Aug 06 11:30:45 2019 +0200
@@ -61,7 +61,7 @@
 
     def __init__(self):
         super(firstmergecache, self).__init__()
-        self._data = array.array('l')
+        self._data = array.array(r'l')
 
     def get(self, rev):
         if len(self._data) <= rev:
@@ -108,7 +108,7 @@
         Subclasses MUST overide this method to actually affect the cache data.
         """
         super(firstmergecache, self).clear()
-        self._data = array.array('l')
+        self._data = array.array(r'l')
 
     # crude version of a cache, to show the kind of information we have to store
 
@@ -117,7 +117,7 @@
         assert repo.filtername is None
 
         data = repo.cachevfs.tryread(self._filepath)
-        self._data = array.array('l')
+        self._data = array.array(r'l')
         if not data:
             self._cachekey = self.emptykey
         else:
--- a/hgext3rd/evolve/stablesort.py	Tue Aug 06 11:29:35 2019 +0200
+++ b/hgext3rd/evolve/stablesort.py	Tue Aug 06 11:30:45 2019 +0200
@@ -525,8 +525,8 @@
 
     def __init__(self):
         super(ondiskstablesortcache, self).__init__()
-        self._index = array.array('l')
-        self._data = array.array('l')
+        self._index = array.array(r'l')
+        self._data = array.array(r'l')
         del self._jumps
 
     def getjumps(self, repo, rev):
@@ -601,8 +601,8 @@
 
     def clear(self, reset=False):
         super(ondiskstablesortcache, self).clear()
-        self._index = array.array('l')
-        self._data = array.array('l')
+        self._index = array.array(r'l')
+        self._data = array.array(r'l')
 
     def load(self, repo):
         """load data from disk
@@ -612,8 +612,8 @@
         assert repo.filtername is None
 
         data = repo.cachevfs.tryread(self._filepath)
-        self._index = array.array('l')
-        self._data = array.array('l')
+        self._index = array.array(r'l')
+        self._data = array.array(r'l')
         if not data:
             self._cachekey = self.emptykey
         else: