~dricottone/apkbuilds

ref: 5f4793401128c761a5f3fc057c1c742fa514d915 apkbuilds/src/py3-celery/7446.patch -rw-r--r-- 1.4 KiB
5f479340Dominic Ricottone Initial commit 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 85a8fcf0a6eb421218d746eedd88d158c450cf35 Mon Sep 17 00:00:00 2001
From: Omer Katz <omer.katz@kcg.tech>
Date: Sat, 9 Apr 2022 13:27:58 +0300
Subject: [PATCH] Avoid importing buf_t from billiard's compat module as it was
 removed.

buf_t was a compatibility layer for 2.7, it's no longer needed so it was removed from billiard.
We should adjust the code in Celery as well.
---
 celery/concurrency/asynpool.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/celery/concurrency/asynpool.py b/celery/concurrency/asynpool.py
index b9f2875a26..489336936c 100644
--- a/celery/concurrency/asynpool.py
+++ b/celery/concurrency/asynpool.py
@@ -26,7 +26,7 @@
 from weakref import WeakValueDictionary, ref
 
 from billiard import pool as _pool
-from billiard.compat import buf_t, isblocking, setblocking
+from billiard.compat import isblocking, setblocking
 from billiard.pool import ACK, NACK, RUN, TERMINATE, WorkersJoined
 from billiard.queues import _SimpleQueue
 from kombu.asynchronous import ERR, WRITE
@@ -868,7 +868,7 @@ def send_job(tup):
             header = pack('>I', body_size)
             # index 1,0 is the job ID.
             job = get_job(tup[1][0])
-            job._payload = buf_t(header), buf_t(body), body_size
+            job._payload = memoryview(header), memoryview(body), body_size
             put_message(job)
         self._quick_put = send_job