summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2020-09-16 11:16:11 +0200
committerChris Liechti <cliechti@gmx.net>2020-09-16 11:16:11 +0200
commit19ec51cd63616c3fd14b481bd05a78f07704adc1 (patch)
treea43553ddecac63718adae3fbaa6b066a9092c4b5
parent690a8d0992c6374c1892308ea798acc379c736f6 (diff)
downloadpyserial-git-19ec51cd63616c3fd14b481bd05a78f07704adc1.tar.gz
list_ports: use hardcoded path to library on osx
due to a security related change on MacOS, find_library fails. which may eventually be fixed with a Python update but it also does not hurt to use the full paths now, that should work on old and new systems. related to #509 #518
-rw-r--r--serial/tools/list_ports_osx.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/serial/tools/list_ports_osx.py b/serial/tools/list_ports_osx.py
index 34a7f5a..0c719db 100644
--- a/serial/tools/list_ports_osx.py
+++ b/serial/tools/list_ports_osx.py
@@ -24,12 +24,11 @@
from __future__ import absolute_import
import ctypes
-import ctypes.util
from serial.tools import list_ports_common
-iokit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('IOKit'))
-cf = ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation'))
+iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit')
+cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
kIOMasterPortDefault = ctypes.c_void_p.in_dll(iokit, "kIOMasterPortDefault")
kCFAllocatorDefault = ctypes.c_void_p.in_dll(cf, "kCFAllocatorDefault")