archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python-twisted / trunk / python310.patch
blob5d77ea336b6b6d6f56840654d0a16aea76314292
1 diff -upr twisted-twisted-21.7.0.orig/src/twisted/internet/test/test_threads.py twisted-twisted-21.7.0/src/twisted/internet/test/test_threads.py
2 --- twisted-twisted-21.7.0.orig/src/twisted/internet/test/test_threads.py 2021-07-26 18:03:56.000000000 +0300
3 +++ twisted-twisted-21.7.0/src/twisted/internet/test/test_threads.py 2021-12-07 00:48:58.573886527 +0200
4 @@ -108,13 +108,13 @@ class ThreadTestsBuilder(ReactorBuilder)
5 result = []
7 def threadCall():
8 - result.append(threading.currentThread())
9 + result.append(threading.current_thread())
10 reactor.stop()
12 reactor.callLater(0, reactor.callInThread, reactor.callFromThread, threadCall)
13 self.runReactor(reactor, 5)
15 - self.assertEqual(result, [threading.currentThread()])
16 + self.assertEqual(result, [threading.current_thread()])
18 def test_stopThreadPool(self):
19 """
20 diff -upr twisted-twisted-21.7.0.orig/src/twisted/python/threadable.py twisted-twisted-21.7.0/src/twisted/python/threadable.py
21 --- twisted-twisted-21.7.0.orig/src/twisted/python/threadable.py 2021-07-26 18:03:56.000000000 +0300
22 +++ twisted-twisted-21.7.0/src/twisted/python/threadable.py 2021-12-07 00:49:02.183979399 +0200
23 @@ -104,7 +104,7 @@ _dummyID = object()
24 def getThreadID():
25 if threadingmodule is None:
26 return _dummyID
27 - return threadingmodule.currentThread().ident
28 + return threadingmodule.current_thread().ident
31 def isInIOThread():
32 diff -upr twisted-twisted-21.7.0.orig/src/twisted/python/threadpool.py twisted-twisted-21.7.0/src/twisted/python/threadpool.py
33 --- twisted-twisted-21.7.0.orig/src/twisted/python/threadpool.py 2021-07-26 18:03:56.000000000 +0300
34 +++ twisted-twisted-21.7.0/src/twisted/python/threadpool.py 2021-12-07 00:49:27.894640858 +0200
35 @@ -9,7 +9,7 @@ In most cases you can just use C{reactor
36 instead of creating a thread pool directly.
37 """
39 -from threading import Thread, currentThread
40 +from threading import Thread, current_thread
41 from typing import List
43 from twisted._threads import pool as _pool
44 @@ -44,7 +44,7 @@ class ThreadPool:
45 name = None
47 threadFactory = Thread
48 - currentThread = staticmethod(currentThread)
49 + currentThread = staticmethod(current_thread)
50 _pool = staticmethod(_pool)
52 def __init__(self, minthreads=5, maxthreads=20, name=None):
53 diff -upr twisted-twisted-21.7.0.orig/src/twisted/test/test_threadpool.py twisted-twisted-21.7.0/src/twisted/test/test_threadpool.py
54 --- twisted-twisted-21.7.0.orig/src/twisted/test/test_threadpool.py 2021-07-26 18:03:56.000000000 +0300
55 +++ twisted-twisted-21.7.0/src/twisted/test/test_threadpool.py 2021-12-07 00:49:41.461656589 +0200
56 @@ -404,11 +404,11 @@ class ThreadPoolTests(unittest.Synchrono
57 event = threading.Event()
59 def onResult(success, result):
60 - threadIds.append(threading.currentThread().ident)
61 + threadIds.append(threading.current_thread().ident)
62 event.set()
64 def func():
65 - threadIds.append(threading.currentThread().ident)
66 + threadIds.append(threading.current_thread().ident)
68 tp = threadpool.ThreadPool(0, 1)
69 tp.callInThreadWithCallback(onResult, func)