summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/heap.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/multiprocessing/heap.py')
-rw-r--r--Lib/multiprocessing/heap.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/multiprocessing/heap.py b/Lib/multiprocessing/heap.py
index a1f3711..0a25ef0 100644
--- a/Lib/multiprocessing/heap.py
+++ b/Lib/multiprocessing/heap.py
@@ -60,7 +60,7 @@ if sys.platform == 'win32':
def __init__(self, size):
self.size = size
- self.name = 'pym-%d-%d' % (os.getpid(), Arena._counter.next())
+ self.name = 'pym-%d-%d' % (os.getpid(), next(Arena._counter))
self.buffer = mmap.mmap(-1, self.size, tagname=self.name)
assert win32.GetLastError() == 0, 'tagname already in use'
self._state = (self.size, self.name)
@@ -213,7 +213,7 @@ class Heap(object):
def malloc(self, size):
# return a block of right size (possibly rounded up)
- assert 0 <= size < sys.maxint
+ assert 0 <= size < sys.maxsize
if os.getpid() != self._lastpid:
self.__init__() # reinitialize after fork
self._lock.acquire()
@@ -239,7 +239,7 @@ class BufferWrapper(object):
_heap = Heap()
def __init__(self, size):
- assert 0 <= size < sys.maxint
+ assert 0 <= size < sys.maxsize
block = BufferWrapper._heap.malloc(size)
self._state = (block, size)
Finalize(self, BufferWrapper._heap.free, args=(block,))