Skip to content

Commit 95965b8

Browse files
Merge pull request #86 from dihm/replace_distutils
Replace distutils
2 parents a88582d + f2f0ac7 commit 95965b8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

labscript_utils/ls_zprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414
import os
1515
from socket import gethostbyname
16-
from distutils.version import LooseVersion
16+
from packaging.version import Version
1717
import zmq
1818

1919
import zprocess
@@ -337,7 +337,7 @@ def connect_to_zlock_server():
337337
global _zlock_server_supports_readwrite
338338
if hasattr(client, 'get_protocol_version'):
339339
version = client.get_protocol_version()
340-
if LooseVersion(version) >= LooseVersion('1.1.0'):
340+
if Version(version) >= Version('1.1.0'):
341341
_zlock_server_supports_readwrite = True
342342

343343
# The user can call these functions to change the timeouts later if they

labscript_utils/modulewatcher.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
import os
1717
import imp
1818
import site
19-
import distutils.sysconfig
19+
import sysconfig
2020

2121

2222
# Directories in which the standard library and installed packages may be located.
2323
# Modules in these locations will be whitelisted:
2424
PKGDIRS = [
25-
distutils.sysconfig.get_python_lib(plat_specific=True, standard_lib=True),
26-
distutils.sysconfig.get_python_lib(plat_specific=True, standard_lib=False),
27-
distutils.sysconfig.get_python_lib(plat_specific=False, standard_lib=True),
28-
distutils.sysconfig.get_python_lib(plat_specific=False, standard_lib=False),
25+
sysconfig.get_path('platstdlib'),
26+
sysconfig.get_path('platlib'),
27+
sysconfig.get_path('stdlib'),
28+
sysconfig.get_path('purelib'),
2929
site.getusersitepackages(),
3030
]
3131
PKGDIRS += site.getsitepackages()

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from setuptools import setup
33
from setuptools.command.develop import develop
4-
from distutils import log
4+
import logging
55

66

77
class develop_command(develop):
@@ -11,7 +11,7 @@ def run(self):
1111
path = os.path.join(self.install_dir, 'labscript-suite.pth')
1212
super().run()
1313
if not self.uninstall:
14-
log.info(f'Copying labscript-suite.pth to {path}')
14+
logging.info(f'Copying labscript-suite.pth to {path}')
1515
if not self.dry_run:
1616
self.copy_file('labscript-suite.pth', path)
1717

0 commit comments

Comments
 (0)