Skip to content

Commit 98ec98d

Browse files
committed
Remove epicscorelibs.path dependency on ProbeToolchain
1 parent 0ceebe4 commit 98ec98d

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

src/python/epicscorelibs/config.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from setuptools_dso.probe import ProbeToolchain
1111

12+
from ..os_class import get_os_class
13+
1214

1315
__all__ = (
1416
'get_config_var',
@@ -17,15 +19,7 @@
1719

1820
def _makeconf():
1921
conf = {}
20-
21-
# cf. Lib/platform.py in cpython source tree
22-
23-
# map from python system name to epics OS_CLASS
24-
osname = conf['OS_CLASS'] = {
25-
'Linux': 'Linux',
26-
'Windows': 'WIN32',
27-
'Darwin': 'Darwin',
28-
}[platform.system()]
22+
osname = conf['OS_CLASS'] = get_os_class()
2923

3024
# select epics CMPLR_CLASS
3125
ID = ProbeToolchain().eval_macros(('__GNUC__', '__clang__', '_MSC_VER'))
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import platform
2+
3+
def get_os_class():
4+
# cf. Lib/platform.py in cpython source tree
5+
6+
# map from python system name to epics OS_CLASS
7+
return {
8+
'Linux': 'Linux',
9+
'Windows': 'WIN32',
10+
'Darwin': 'Darwin',
11+
}[platform.system()]

src/python/epicscorelibs/path/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from glob import glob
44

5-
from ..config import get_config_var
5+
from ..os_class import get_os_class
66
from setuptools_dso.runtime import dylink_prepare_dso, find_dso
77

88
__all__ = (
@@ -15,7 +15,7 @@
1515

1616

1717
# parts of library file names
18-
OS_CLASS = get_config_var("OS_CLASS")
18+
OS_CLASS = get_os_class()
1919
if OS_CLASS=='WIN32':
2020
_prefix, _suffix = '', '.dll'
2121
elif OS_CLASS=='Darwin':

0 commit comments

Comments
 (0)