From daec717903d2b63a4e8e57203c90797cbc01e8cb Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 16 Oct 2023 11:27:08 -0400 Subject: [PATCH] Lints --- src/allmydata/client.py | 1 - src/allmydata/mutable/publish.py | 2 +- src/allmydata/mutable/retrieve.py | 2 +- src/allmydata/storage/http_client.py | 3 +-- src/allmydata/test/test_util.py | 1 - src/allmydata/util/cputhreadpool.py | 1 - 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 9a1a75ebc..803d2946e 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -22,7 +22,6 @@ from zope.interface import implementer from twisted.plugin import ( getPlugins, ) -from twisted.internet.interfaces import IReactorFromThreads from twisted.internet import reactor, defer from twisted.application import service from twisted.application.internet import TimerService diff --git a/src/allmydata/mutable/publish.py b/src/allmydata/mutable/publish.py index bc87d5e0c..3565d0d73 100644 --- a/src/allmydata/mutable/publish.py +++ b/src/allmydata/mutable/publish.py @@ -14,7 +14,7 @@ import os, time from io import BytesIO from itertools import count from zope.interface import implementer -from twisted.internet import defer, reactor +from twisted.internet import defer from twisted.python import failure from allmydata.crypto import aes diff --git a/src/allmydata/mutable/retrieve.py b/src/allmydata/mutable/retrieve.py index 22e846aa5..955ff39ed 100644 --- a/src/allmydata/mutable/retrieve.py +++ b/src/allmydata/mutable/retrieve.py @@ -7,7 +7,7 @@ import time from itertools import count from zope.interface import implementer -from twisted.internet import defer, reactor +from twisted.internet import defer from twisted.python import failure from twisted.internet.interfaces import IPushProducer, IConsumer from foolscap.api import eventually, fireEventually, DeadReferenceError, \ diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index f3aef8b88..7f6fecb98 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -39,7 +39,6 @@ from twisted.internet.interfaces import ( IOpenSSLClientConnectionCreator, IReactorTime, IDelayedCall, - IReactorFromThreads, ) from twisted.internet.ssl import CertificateOptions from twisted.protocols.tls import TLSMemoryBIOProtocol @@ -438,7 +437,7 @@ class StorageClient(object): _swissnum: bytes _treq: Union[treq, StubTreq, HTTPClient] _pool: HTTPConnectionPool - _clock: Union[IReactorTime, IReactorFromThreads] + _clock: IReactorTime # Are we running unit tests? _analyze_response: Callable[[IResponse], None] = lambda _: None diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index 2b3f33474..3b77b55a4 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -18,7 +18,6 @@ import json from threading import current_thread from twisted.trial import unittest -from twisted.internet import reactor from foolscap.api import Violation, RemoteException from allmydata.util import idlib, mathutil diff --git a/src/allmydata/util/cputhreadpool.py b/src/allmydata/util/cputhreadpool.py index 33799e150..e8b439eee 100644 --- a/src/allmydata/util/cputhreadpool.py +++ b/src/allmydata/util/cputhreadpool.py @@ -24,7 +24,6 @@ from unittest import TestCase from twisted.python.threadpool import ThreadPool from twisted.internet.defer import Deferred, maybeDeferred from twisted.internet.threads import deferToThreadPool -from twisted.internet.interfaces import IReactorFromThreads from twisted.internet import reactor _CPU_THREAD_POOL = ThreadPool(minthreads=0, maxthreads=os.cpu_count(), name="TahoeCPU")