From f663581ed32e2d0f1206074cca21151d227bf3bc Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 2 Aug 2023 16:27:18 -0600 Subject: [PATCH] temporarily remove new provides() usage --- integration/grid.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/integration/grid.py b/integration/grid.py index b9af7ed5d..c39b9cff9 100644 --- a/integration/grid.py +++ b/integration/grid.py @@ -31,10 +31,8 @@ from twisted.internet.defer import ( from twisted.internet.task import ( deferLater, ) -from twisted.internet.interfaces import ( - IProcessTransport, - IProcessProtocol, -) +from twisted.internet.protocol import ProcessProtocol # see ticket 4056 +from twisted.internet.process import Process # see ticket 4056 from twisted.internet.error import ProcessTerminated from allmydata.node import read_config @@ -71,11 +69,17 @@ class FlogGatherer(object): Flog Gatherer process. """ + # it would be best to use attr.validators.provides() here with the + # corresponding Twisted interface (IProcessTransport, + # IProcessProtocol) but that is deprecated; please replace with + # our own "provides" as part of + # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4056#ticket + # insisting on a subclass is narrower than necessary process = attr.ib( - validator=attr.validators.provides(IProcessTransport) + validator=attr.validators.instance_of(Process) ) protocol = attr.ib( - validator=attr.validators.provides(IProcessProtocol) + validator=attr.validators.instance_of(ProcessProtocol) ) furl = attr.ib() @@ -155,7 +159,7 @@ class StorageServer(object): validator=attr.validators.instance_of(TahoeProcess) ) protocol = attr.ib( - validator=attr.validators.provides(IProcessProtocol) + validator=attr.validators.instance_of(ProcessProtocol) ) @inlineCallbacks @@ -207,7 +211,7 @@ class Client(object): validator=attr.validators.instance_of(TahoeProcess) ) protocol = attr.ib( - validator=attr.validators.provides(IProcessProtocol) + validator=attr.validators.instance_of(ProcessProtocol) ) request = attr.ib() # original request, for addfinalizer() @@ -335,7 +339,7 @@ class Introducer(object): validator=attr.validators.instance_of(TahoeProcess) ) protocol = attr.ib( - validator=attr.validators.provides(IProcessProtocol) + validator=attr.validators.instance_of(ProcessProtocol) ) furl = attr.ib()