MOTOR-1214 Ignore IOLoop.current deprecation to make synchro pass (#236)
This commit is contained in:
parent
4513307899
commit
cb050ef3d7
@ -22,6 +22,7 @@ DO NOT USE THIS MODULE.
|
||||
import functools
|
||||
import inspect
|
||||
import unittest
|
||||
import warnings
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
# Make e.g. "from pymongo.errors import AutoReconnect" work. Note that
|
||||
@ -337,7 +338,9 @@ class Synchro(metaclass=SynchroMeta):
|
||||
def partial():
|
||||
return async_method(*args, **kwargs)
|
||||
|
||||
return IOLoop.current().run_sync(partial)
|
||||
with warnings.catch_warnings(action="ignore", category=DeprecationWarning):
|
||||
loop = IOLoop.current()
|
||||
return loop.run_sync(partial)
|
||||
|
||||
return synchronized_method
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user