| 1 | From 7f6f613826aef9810999c1599c8354e8a78fbdb4 Mon Sep 17 00:00:00 2001
|
| 2 | From: Lukas1818 <[email protected]>
|
| 3 | Date: Fri, 19 Feb 2021 21:08:44 +0100
|
| 4 | Subject: [PATCH] fixs for Phyton 3.9 (#2955)
|
| 5 |
|
| 6 | * change deprecated isAlive() to is_alive()
|
| 7 |
|
| 8 | * remove unsupported keyword "encoding"
|
| 9 |
|
| 10 | Co-authored-by: Lukas1818 <[email protected]>
|
| 11 | ---
|
| 12 | horizons/util/loaders/jsondecoder.py | 2 +-
|
| 13 | horizons/util/preloader.py | 4 ++--
|
| 14 | 2 files changed, 3 insertions(+), 3 deletions(-)
|
| 15 |
|
| 16 | diff --git a/horizons/util/loaders/jsondecoder.py b/horizons/util/loaders/jsondecoder.py
|
| 17 | index ea2ddfb3308..138a948f42a 100644
|
| 18 | |
| 19 | |
| 20 | @@ -37,4 +37,4 @@ def _decode_dict(dct):
|
| 21 | return newdict
|
| 22 |
|
| 23 | with open(path, "r") as f:
|
| 24 | - return json.load(f, encoding="ascii", object_hook=_decode_dict)
|
| 25 | + return json.load(f, object_hook=_decode_dict)
|
| 26 | diff --git a/horizons/util/preloader.py b/horizons/util/preloader.py
|
| 27 | index 5689cc68152..2e072fcc642 100644
|
| 28 | |
| 29 | |
| 30 | @@ -79,9 +79,9 @@ def wait_for_finish(self):
|
| 31 | """
|
| 32 | self.lock.acquire()
|
| 33 | # wait until it finished its current action
|
| 34 | - if self.isAlive():
|
| 35 | + if self.is_alive():
|
| 36 | self.join()
|
| 37 | - assert not self.isAlive()
|
| 38 | + assert not self.is_alive()
|
| 39 | else:
|
| 40 | try:
|
| 41 | self.lock.release()
|