From 57acb4d0ecb4fcb55daf3bb2d750aa760a81eec6 Mon Sep 17 00:00:00 2001
From: Mathias Ertl <mati@er.tl>
Date: Sat, 24 Dec 2022 10:40:19 +0100
Subject: [PATCH] return list of nodes to make sphinx extension compatible with
 Sphinx 6.0

---
 celery/contrib/sphinx.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/celery/contrib/sphinx.py b/celery/contrib/sphinx.py
index a3a06479ccf..a5505ff189a 100644
--- a/celery/contrib/sphinx.py
+++ b/celery/contrib/sphinx.py
@@ -32,6 +32,7 @@
 """
 from inspect import signature
 
+from docutils import nodes
 from sphinx.domains.python import PyFunction
 from sphinx.ext.autodoc import FunctionDocumenter
 
@@ -75,7 +76,7 @@ class TaskDirective(PyFunction):
     """Sphinx task directive."""
 
     def get_signature_prefix(self, sig):
-        return self.env.config.celery_task_prefix
+        return [nodes.Text(self.env.config.celery_task_prefix)]
 
 
 def autodoc_skip_member_handler(app, what, name, obj, skip, options):
