From ccf6fe27a8b8da9ff6a1e5d4008645921b455ae9 Mon Sep 17 00:00:00 2001 From: WaanofiiTech Date: Thu, 26 Nov 2020 04:19:03 -0800 Subject: [PATCH 1/2] Fix deprecated attribute call. Since Python 3.3 time.clock() has been deprecated, if we are using latest Python we have to change it to time.pref_counter(). For more information: https://www.geeksforgeeks.org/time-perf_counter-function-in-python/ --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index b0590ad9..bfdcd32c 100644 --- a/main.py +++ b/main.py @@ -419,8 +419,8 @@ def process_queue(self): add_block() or remove_block() was called with immediate=False """ - start = time.clock() - while self.queue and time.clock() - start < 1.0 / TICKS_PER_SEC: + start = time.perf_counter() + while self.queue and time.perf_counter() - start < 1.0 / TICKS_PER_SEC: self._dequeue() def process_entire_queue(self): From ce3825e4c353cfb3201f86687e718891e095e8b8 Mon Sep 17 00:00:00 2001 From: WaanofiiTech Date: Thu, 26 Nov 2020 04:19:03 -0800 Subject: [PATCH 2/2] Fix deprecated Attribute call time.clock(). Since Python 3.3 time.clock() has been deprecated, if we are using latest Python we have to change it to time.pref_counter(). For more information: https://www.geeksforgeeks.org/time-perf_counter-function-in-python/ --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index b0590ad9..bfdcd32c 100644 --- a/main.py +++ b/main.py @@ -419,8 +419,8 @@ def process_queue(self): add_block() or remove_block() was called with immediate=False """ - start = time.clock() - while self.queue and time.clock() - start < 1.0 / TICKS_PER_SEC: + start = time.perf_counter() + while self.queue and time.perf_counter() - start < 1.0 / TICKS_PER_SEC: self._dequeue() def process_entire_queue(self):