Skip to content

Commit 86e63d4

Browse files
committed
Replace deprecated distutils package
The package `distutils` is deprecated since python 3.10 and it is scheduled to be removed with python 3.12, see: https://docs.python.org/3.12/whatsnew/3.12.html python/cpython#92584 `shutil.copytree()` is able to copy the source directory tree to an existing destination directory only from python 3.8 (parameter `dirs_exist_ok=True`), for python < 3.8 still use `distutils.dir_util.copy_tree()` Raise worker version to 214 (also server side)
1 parent e2acf2c commit 86e63d4

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

server/fishtest/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
on how frequently the main instance flushes its run cache.
2626
"""
2727

28-
WORKER_VERSION = 213
28+
WORKER_VERSION = 214
2929

3030

3131
def validate_request(request):

worker/sri.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"__version": 213, "updater.py": "GEDqwD5F16roa/hRFbTNbbUqW/smvbe/4Rcf09O5BIJOAI63wsAVgLEnMtQp1naZ", "worker.py": "dT4tz1DqISrMUZhqlQNV94nvpf6EPVg0ebs118cSJ8gC7C22PetaQjQgA1Ciupm4", "games.py": "LyUiwCAMXllQWLIHsWGZpQpziYGO6dK3jDXzimEFd2ehLLrp5nsSGbl7+AUQTnAa"}
1+
{"__version": 214, "updater.py": "jkqHSdrm3XNEDF2Xck73ZgH3zx6fauZuYlkvYRj1kTaO+qzB/DLQvXy3NTQ0AkRt", "worker.py": "DAMoJ5Rh2a7U8hqA9LX1zba0o8uvrGQVfF+6vcs32SnUDhYen9VYajljx6mzFhAn", "games.py": "LyUiwCAMXllQWLIHsWGZpQpziYGO6dK3jDXzimEFd2ehLLrp5nsSGbl7+AUQTnAa"}

worker/updater.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import shutil
33
import sys
44
from datetime import datetime, timezone
5-
from distutils.dir_util import copy_tree
65
from pathlib import Path
76
from zipfile import ZipFile
87

@@ -57,7 +56,14 @@ def update(restart=True, test=False):
5756
sep="",
5857
file=sys.stderr,
5958
)
60-
copy_tree(str(worker_src), str(worker_dir))
59+
if sys.version_info >= (3, 8):
60+
from shutil import copytree
61+
62+
copytree(worker_src, worker_dir, dirs_exist_ok=True)
63+
else:
64+
from distutils.dir_util import copy_tree
65+
66+
copy_tree(str(worker_src), str(worker_dir))
6167
else:
6268
file_list = os.listdir(worker_src)
6369
shutil.rmtree(update_dir)

worker/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
# Several packages are called "expression".
5555
# So we make sure to use the locally installed one.
5656

57-
WORKER_VERSION = 213
57+
WORKER_VERSION = 214
5858
FILE_LIST = ["updater.py", "worker.py", "games.py"]
5959
HTTP_TIMEOUT = 30.0
6060
INITIAL_RETRY_TIME = 15.0

0 commit comments

Comments
 (0)