Skip to content

Commit

Permalink
Merge 9467-adbapi-reactor: Make ADBAPI use the passed in reactor
Browse files Browse the repository at this point in the history
Author: hawkowl
Reviewer: markrwilliams
Fixes: ticket:9467
  • Loading branch information
hawkowl authored Jul 1, 2018
2 parents 2de804a + b9cad84 commit 28fe002
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/twisted/enterprise/adbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ def runWithConnection(self, func, *args, **kw):
C{func(Transaction(...), *args, **kw)}, or a
L{twisted.python.failure.Failure}.
"""
from twisted.internet import reactor
return threads.deferToThreadPool(reactor, self.threadpool,
return threads.deferToThreadPool(self._reactor, self.threadpool,
self._runWithConnection,
func, *args, **kw)

Expand Down Expand Up @@ -335,8 +334,7 @@ def runInteraction(self, interaction, *args, **kw):
C{interaction(Transaction(...), *args, **kw)}, or a
L{twisted.python.failure.Failure}.
"""
from twisted.internet import reactor
return threads.deferToThreadPool(reactor, self.threadpool,
return threads.deferToThreadPool(self._reactor, self.threadpool,
self._runInteraction,
interaction, *args, **kw)

Expand Down
1 change: 1 addition & 0 deletions src/twisted/newsfragments/9467.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twisted.enterprise.adbapi.ConnectionPool.runWithConnection and runInteraction now use the reactor that is passed to ConnectionPool's constructor.
2 changes: 1 addition & 1 deletion src/twisted/test/test_adbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def __init__(self):
"""
Don't forward init call.
"""
self.reactor = reactor
self._reactor = reactor



Expand Down

0 comments on commit 28fe002

Please sign in to comment.