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