Origin: https://github.com/arskom/spyne/pull/707
From: Eric Atkin <eatkin@certusllc.us>
Date: Wed, 1 May 2024 17:31:50 -0600
Subject: Use classImplements() instead of deprecated implements()

---
 spyne/client/twisted/__init__.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/spyne/client/twisted/__init__.py b/spyne/client/twisted/__init__.py
index aaf65e9c4..70a79594e 100644
--- a/spyne/client/twisted/__init__.py
+++ b/spyne/client/twisted/__init__.py
@@ -26,6 +26,8 @@
 from spyne.client import RemoteProcedureBase
 from spyne.client import ClientBase
 
+from zope.interface import classImplements
+
 from twisted.internet import reactor
 from twisted.internet.defer import Deferred
 from twisted.internet.protocol import Protocol
@@ -39,10 +41,6 @@
 
 
 class _Producer(object):
-    if six.PY2:
-        from zope.interface import implements
-        implements(IBodyProducer)
-
     _deferred = None
 
     def __init__(self, body):
@@ -84,6 +82,10 @@ def stopProducing(self):
         self.__paused = True
 
 
+if six.PY2:
+    classImplements(_Producer, IBodyProducer)
+
+
 class _Protocol(Protocol):
     def __init__(self, ctx):
         self.ctx = ctx
