cp -rf pypy3.8/examples . cp -rf pypy3.8/doc . cp -f pypy3.8/index.html . cp -rf pypy3.8/module . cp -rf pypy3.9-v7.3.8-src/lib-python/3/multiprocessing multiprocess cp -rf pypy3.9-v7.3.8-src/lib-python/3/test/test_multiprocessing_*py multiprocess/tests cp -rf pypy3.9-v7.3.8-src/lib-python/3/test/_test_multiprocessing.py multiprocess/tests/__init__.py cp -rf pypy3.9-v7.3.8-src/lib-python/3/test/mp_*py multiprocess/tests/ cp -rf pypy3.8/multiprocess/tests/__main__.py multiprocess/tests/ cp -rf pypy3.8/_multiprocess . # ---------------------------------------------------------------------- EDIT multiprocess/__init__: __version__ EDIT time.monotonic --> getattr(time,'monotonic',time.time) EDIT "spawn" --> "fork" for darwin context EDIT multiprocess: multiprocessing --> multiprocess EDIT multiprocess: pickle --> dill ADDED *args, **kwds for ForkingPickler in __init__ and dump EDIT multiprocess/dummy: multiprocessing --> multiprocess EDIT multiprocess/tests: multiprocessing --> multiprocess # ---------------------------------------------------------------------- diff py3.9/multiprocess/forkserver.py pypy3.9/multiprocess/forkserver.py 240a241 > diff py3.9/multiprocess/managers.py pypy3.9/multiprocess/managers.py 1154c1154 < '__setitem__', 'clear', 'copy', 'get', 'has_key', 'items', --- > '__setitem__', 'clear', 'copy', 'get', 'items', diff py3.9/multiprocess/shared_memory.py pypy3.9/multiprocess/shared_memory.py 320,322d319 < _recreation_codes = [ < self._extract_recreation_code(item) for item in sequence < ] 428c425 < offset = self._offset_data_start + self._allocated_offsets[position] --- > offset = self._offset_data_start + self._allocated_offsets[position] diff py3.9/multiprocess/synchronize.py pypy3.9/multiprocess/synchronize.py 32c32 < except ImportError: --- > except (ImportError): # ---------------------------------------------------------------------- diff py3.9/multiprocess/tests/__init__.py pypy3.9/multiprocess/tests/__init__.py 568a569 > @unittest.skipIf(True, 'bad pipe in pypy3') 612c613,614 < gc.collect() # For PyPy or other GCs. --- > for i in range(3): > gc.collect() 1940a1943 > @unittest.skipIf(True, 'bad timeout in pypy3') 1959a1963 > @unittest.skipIf(True, 'bad timeout in pypy3') 2671c2673,2674 < gc.collect() # For PyPy or other GCs. --- > for i in range(3): > gc.collect() 2759a2763,2765 > sm = multiprocessing.get_start_method() > if sm == 'fork' and sys.implementation.name == 'pypy': > self.skipTest("race condition on PyPy") 2968c2974,2975 < self.assertRaises(Exception, queue.put, time.sleep) --- > # Changed on PyPy: passing functions to xmlrpc is broken > #self.assertRaises(Exception, queue.put, time.sleep) 3608c3615 < def test_heap(self): --- > def _test_heap(self): 3665a3673,3674 > support.gc_collect() # for PyPy and other GCs > 3671a3681 > @test.support.cpython_only 3778c3788 < # running multiprocessing tests (test_multiprocessing_fork, --- > # running multiprocess tests (test_multiprocessing_fork, 4191c4200,4201 < gc.collect() # For PyPy or other GCs. --- > for i in range(3): > gc.collect() 4245a4256 > @test.support.cpython_only 5101c5112 < def test_preload_resources(self): --- > def _test_preload_resources(self): # ---------------------------------------------------------------------- $ diff pypy3.9-v7.3.8-src/lib-python/3/test/_test_multiprocessing.py pypy3.9-v7.3.9-src/lib-python/3/test/_test_multiprocessing.py 71a72,77 > if support.check_sanitizer(address=True): > # bpo-45200: Skip multiprocessing tests if Python is built with ASAN to > # work around a libasan race condition: dead lock in pthread_create(). > raise unittest.SkipTest("libasan has a pthread_create() dead lock") > # ---------------------------------------------------------------------- diff pypy3.9-v7.3.9-src/pypy/module/_multiprocessing/interp_memory.py pypy3.9-v7.3.10-src/pypy/module/_multiprocessing/interp_memory.py 10,11c10,11 < return space.newtuple([space.newint(address), < space.newint(mmap.mmap.size)]) --- > return space.newtuple2(space.newint(address), > space.newint(mmap.mmap.size)) # ---------------------------------------------------------------------- diff pypy3.9-v7.3.9-src/lib-python/3/multiprocessing/connection.py pypy3.9-v7.3.10-src/lib-python/3/multiprocessing/connection.py 76,80d75 < # Prefer abstract sockets if possible to avoid problems with the address < # size. When coding portable applications, some implementations have < # sun_path as short as 92 bytes in the sockaddr_un struct. < if util.abstract_sockets_supported: < return f"\0listener-{os.getpid()}-{next(_mmap_counter)}" diff pypy3.9-v7.3.9-src/lib-python/3/multiprocessing/managers.py pypy3.9-v7.3.10-src/lib-python/3/multiprocessing/managers.py 672c672 < process.join(timeout=0.1) --- > process.join(timeout=1.0) diff pypy3.9-v7.3.9-src/lib-python/3/multiprocessing/queues.py pypy3.9-v7.3.10-src/lib-python/3/multiprocessing/queues.py 142,148c142,145 < try: < self._reader.close() < finally: < close = self._close < if close: < self._close = None < close() --- > close = self._close > if close: > self._close = None > close() 172,173c169,171 < self._wlock, self._writer.close, self._ignore_epipe, < self._on_queue_feeder_error, self._sem), --- > self._wlock, self._reader.close, self._writer.close, > self._ignore_epipe, self._on_queue_feeder_error, > self._sem), 214,215c212,213 < def _feed(buffer, notempty, send_bytes, writelock, close, ignore_epipe, < onerror, queue_sem): --- > def _feed(buffer, notempty, send_bytes, writelock, reader_close, > writer_close, ignore_epipe, onerror, queue_sem): 241c239,240 < close() --- > reader_close() > writer_close() diff pypy3.9-v7.3.9-src/lib-python/3/multiprocessing/util.py pypy3.9-v7.3.10-src/lib-python/3/multiprocessing/util.py 123c123 < raise TypeError('address type of {address!r} unrecognized') --- > raise TypeError(f'address type of {address!r} unrecognized') # ---------------------------------------------------------------------- diff pypy3.9-v7.3.9-src/pypy/module/_multiprocessing/test/test_interp_semaphore.py pypy3.9-v7.3.11-src/pypy/module/_multiprocessing/test/test_interp_semaphore.py 5d4 < from pypy.tool.pytest.objspace import gettestobjspace 15a15 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") diff pypy3.9-v7.3.9-src/pypy/module/_multiprocessing/test/test_semaphore.py pypy3.9-v7.3.11-src/pypy/module/_multiprocessing/test/test_semaphore.py 2a3 > import pytest 70a72 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") 92a95 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") 117a121 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") 129a134 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") 151a157 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") 167a174 > @pytest.mark.skipif(sys.platform == 'darwin', reason="Hangs on macOSX") # ---------------------------------------------------------------------- diff pypy3.9-v7.3.15-src/lib-python/3/multiprocessing/managers.py pypy3.9-v7.3.16-src/lib-python/3/multiprocessing/managers.py 721a722 > conn.close() diff pypy3.9-v7.3.15-src/lib-python/3/multiprocessing/popen_spawn_win32.py pypy3.9-v7.3.16-src/lib-python/3/multiprocessing/popen_spawn_win32.py 25c25,27 < WINENV = not _path_eq(sys.executable, sys._base_executable) --- > # PyPy is not affected by bpo-35797 > # WINENV = not _path_eq(sys.executable, sys._base_executable) > WINENV = False # ---------------------------------------------------------------------- NOTE: semaphore_tracker throws KeyError in multiprocess and multiprocessing Traceback (most recent call last): File "multiprocess/resource_tracker.py", line 204, in main cache[rtype].remove(name) KeyError: '/mp-v2zejd7s'