Skip to content

Commit a66d7f6

Browse files
Merge pull request #43 from epics-base/path-no-probe
Remove epicscorelibs.path dependency on compiler
2 parents 0ceebe4 + dc583a6 commit a66d7f6

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

src/python/epicscorelibs/ca/cadef.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717

1818

1919
import ctypes
20+
import platform
2021

2122
from epicscorelibs import path
2223

2324
from . import py23
2425

25-
if path.OS_CLASS == "WIN32":
26+
if platform.system() == "Windows":
2627
# On windows, use stdcall calling convention for libca
2728
libca = ctypes.WinDLL(path.get_lib("ca"), ctypes.RTLD_GLOBAL)
2829
else:

src/python/epicscorelibs/ioc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import ctypes
66
import code
77
import argparse
8+
import platform
89
import sys
910
import os
1011
import atexit
@@ -15,7 +16,7 @@
1516

1617

1718
# The libraries we need to run up a soft IOC, don't load dbCore twice
18-
if path.OS_CLASS == "WIN32":
19+
if platform.system() == "Windows":
1920
Com = ctypes.WinDLL(path.get_lib("Com"), mode=ctypes.RTLD_GLOBAL)
2021
else:
2122
Com = ctypes.CDLL(path.get_lib("Com"), mode=ctypes.RTLD_GLOBAL)

src/python/epicscorelibs/path/__init__.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
import os
3-
from glob import glob
43

5-
from ..config import get_config_var
64
from setuptools_dso.runtime import dylink_prepare_dso, find_dso
75

86
__all__ = (
@@ -12,17 +10,6 @@
1210
)
1311

1412
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
15-
16-
17-
# parts of library file names
18-
OS_CLASS = get_config_var("OS_CLASS")
19-
if OS_CLASS=='WIN32':
20-
_prefix, _suffix = '', '.dll'
21-
elif OS_CLASS=='Darwin':
22-
_prefix, _suffix = 'lib', '.dylib'
23-
else:
24-
_prefix, _suffix = 'lib', '.so'
25-
2613
include_path = os.path.join(base_path, 'include')
2714
lib_path = os.path.join(base_path, 'lib')
2815

src/python/epicscorelibs/test/test_load.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import os
55
import ctypes
6+
import platform
67

78
from .. import path
89

@@ -14,7 +15,7 @@ def test_loading():
1415

1516
ca = ctypes.CDLL(path.get_lib('ca'), mode=ctypes.RTLD_GLOBAL)
1617

17-
if path.OS_CLASS=='WIN32':
18+
if platform.system() == "Windows":
1819
# Base libs contain functions using a mixture of cdecl and stdcall calling conventions
1920
# make WinDLL w/o actually loading again
2021
ca_s = ctypes.WinDLL(ca._name, handle=ca._handle)

0 commit comments

Comments
 (0)