From 5a0e9025e705ab608f33cf60c54a8873f78daeef Mon Sep 17 00:00:00 2001
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Date: Sun, 9 May 2021 02:07:44 +0530
Subject: [PATCH] Set daemon attribute instead of using setDaemon method that
 was deprecated in Python 3.10 (#570)

---
 rx/scheduler/timeoutscheduler.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rx/scheduler/timeoutscheduler.py b/rx/scheduler/timeoutscheduler.py
index 361b112e..eeb20103 100644
--- a/rx/scheduler/timeoutscheduler.py
+++ b/rx/scheduler/timeoutscheduler.py
@@ -48,7 +48,7 @@ def interval() -> None:
             sad.disposable = self.invoke_action(action, state)
 
         timer = Timer(0, interval)
-        timer.setDaemon(True)
+        timer.daemon = True
         timer.start()
 
         def dispose() -> None:
@@ -83,7 +83,7 @@ def interval() -> None:
             sad.disposable = self.invoke_action(action, state)
 
         timer = Timer(seconds, interval)
-        timer.setDaemon(True)
+        timer.daemon = True
         timer.start()
 
         def dispose() -> None:
From 246eabfefd17a25951f59bb2dfce4262c0ed2888 Mon Sep 17 00:00:00 2001
From: Carl George <carl@george.computer>
Date: Sat, 3 Jul 2021 14:58:42 -0500
Subject: [PATCH] Remove deprecated loop parameter (#575)

asyncio.sleep's loop parameter has been deprecated since Python 3.8, and
is removed in 3.10.  The tests fail on 3.10 unless this is removed.

https://docs.python.org/3.10/library/asyncio-task.html#sleeping
---
 .../test_eventloop/test_asyncioscheduler.py            |  8 ++++----
 .../test_eventloop/test_asynciothreadsafescheduler.py  | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py b/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
index c0ad7ea5..c0aaad0c 100644
--- a/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
+++ b/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
@@ -18,7 +18,7 @@ def test_asyncio_schedule_now_units(self):
         loop = asyncio.get_event_loop()
         scheduler = AsyncIOScheduler(loop)
         diff = scheduler.now
-        yield from asyncio.sleep(0.1, loop=loop)
+        yield from asyncio.sleep(0.1)
         diff = scheduler.now - diff
         assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)
 
@@ -36,7 +36,7 @@ def action(scheduler, state):
 
             scheduler.schedule(action)
 
-            yield from asyncio.sleep(0.1, loop=loop)
+            yield from asyncio.sleep(0.1)
             assert ran is True
 
         loop.run_until_complete(go())
@@ -56,7 +56,7 @@ def action(scheduler, state):
 
             scheduler.schedule_relative(0.2, action)
 
-            yield from asyncio.sleep(0.3, loop=loop)
+            yield from asyncio.sleep(0.3)
             assert endtime is not None
             diff = endtime - starttime
             assert diff > 0.18
@@ -78,7 +78,7 @@ def action(scheduler, state):
             d = scheduler.schedule_relative(0.05, action)
             d.dispose()
 
-            yield from asyncio.sleep(0.3, loop=loop)
+            yield from asyncio.sleep(0.3)
             assert ran is False
 
         loop.run_until_complete(go())
diff --git a/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py b/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
index e09af2ca..b571e371 100644
--- a/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
+++ b/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
@@ -19,7 +19,7 @@ def test_asyncio_threadsafe_schedule_now_units(self):
         loop = asyncio.get_event_loop()
         scheduler = AsyncIOThreadSafeScheduler(loop)
         diff = scheduler.now
-        yield from asyncio.sleep(0.1, loop=loop)
+        yield from asyncio.sleep(0.1)
         diff = scheduler.now - diff
         assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)
 
@@ -40,7 +40,7 @@ def schedule():
 
             threading.Thread(target=schedule).start()
 
-            yield from asyncio.sleep(0.1, loop=loop)
+            yield from asyncio.sleep(0.1)
             assert ran is True
 
         loop.run_until_complete(go())
@@ -63,7 +63,7 @@ def schedule():
 
             threading.Thread(target=schedule).start()
 
-            yield from asyncio.sleep(0.3, loop=loop)
+            yield from asyncio.sleep(0.3)
             assert endtime is not None
             diff = endtime - starttime
             assert diff > 0.18
@@ -88,7 +88,7 @@ def schedule():
 
             threading.Thread(target=schedule).start()
 
-            yield from asyncio.sleep(0.3, loop=loop)
+            yield from asyncio.sleep(0.3)
             assert ran is False
 
         loop.run_until_complete(go())
@@ -112,7 +112,7 @@ def thread_target():
 
             @asyncio.coroutine
             def go():
-                yield from asyncio.sleep(0.2, loop=loop)
+                yield from asyncio.sleep(0.2)
 
             loop.run_until_complete(go())
 
