mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix some windows tests
This commit is contained in:
parent
a2bebacc07
commit
094c2c16d8
1 changed files with 8 additions and 2 deletions
|
@ -19,12 +19,18 @@ def current_ioloop(io_loop):
|
|||
"""
|
||||
A context manager that will set the current ioloop to io_loop for the context
|
||||
"""
|
||||
orig_loop = salt.ext.tornado.ioloop.IOLoop.current()
|
||||
try:
|
||||
orig_loop = salt.ext.tornado.ioloop.IOLoop.current()
|
||||
except RuntimeError:
|
||||
orig_loop = None
|
||||
io_loop.make_current()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
orig_loop.make_current()
|
||||
if orig_loop:
|
||||
orig_loop.make_current()
|
||||
else:
|
||||
io_loop.clear_current()
|
||||
|
||||
|
||||
class SyncWrapper:
|
||||
|
|
Loading…
Add table
Reference in a new issue