mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-25 07:31:07 +00:00
Fix SignalMixin
This commit is contained in:
parent
3814ccb947
commit
e26895b149
@ -120,7 +120,7 @@ class NonASCIIPathMixin:
|
|||||||
return unicode_name
|
return unicode_name
|
||||||
|
|
||||||
|
|
||||||
class SignalMixin:
|
class SignalMixin(object):
|
||||||
# This class is necessary for any code which wants to use Processes
|
# This class is necessary for any code which wants to use Processes
|
||||||
# outside the usual reactor.run() environment. It is copied from
|
# outside the usual reactor.run() environment. It is copied from
|
||||||
# Twisted's twisted.test.test_process . Note that Twisted-8.2.0 uses
|
# Twisted's twisted.test.test_process . Note that Twisted-8.2.0 uses
|
||||||
@ -134,10 +134,12 @@ class SignalMixin:
|
|||||||
if hasattr(reactor, "_handleSigchld") and hasattr(signal, "SIGCHLD"):
|
if hasattr(reactor, "_handleSigchld") and hasattr(signal, "SIGCHLD"):
|
||||||
self.sigchldHandler = signal.signal(signal.SIGCHLD,
|
self.sigchldHandler = signal.signal(signal.SIGCHLD,
|
||||||
reactor._handleSigchld)
|
reactor._handleSigchld)
|
||||||
|
return super(SignalMixin, self).setUp()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
if self.sigchldHandler:
|
if self.sigchldHandler:
|
||||||
signal.signal(signal.SIGCHLD, self.sigchldHandler)
|
signal.signal(signal.SIGCHLD, self.sigchldHandler)
|
||||||
|
return super(SignalMixin, self).tearDown()
|
||||||
|
|
||||||
class StallMixin:
|
class StallMixin:
|
||||||
def stall(self, res=None, delay=1):
|
def stall(self, res=None, delay=1):
|
||||||
|
Loading…
Reference in New Issue
Block a user