From 8036708c4e4d764ec54ee516f759ee3a2a519f77 Mon Sep 17 00:00:00 2001 From: MichaelPlug Date: Fri, 22 Apr 2022 12:30:34 +0200 Subject: [PATCH 1/2] checkLibrary function --- PythonKit/PythonLibrary.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PythonKit/PythonLibrary.swift b/PythonKit/PythonLibrary.swift index 9cbd1a4..d17622f 100644 --- a/PythonKit/PythonLibrary.swift +++ b/PythonKit/PythonLibrary.swift @@ -213,6 +213,12 @@ extension PythonLibrary { self.enforceNonLoadedPythonLibrary() PythonLibrary.Environment.library.set(path) } + + public static func checkLibrary() -> Bool { + let pythonLibraryHandleTest = Self.loadPythonLibrary() + return Self.isPythonLibraryLoaded(at: pythonLibraryHandleTest) + } + } // `PythonVersion` struct that defines a given Python version. From b1577a235790e254f3f12572a9dc78b4dffa4237 Mon Sep 17 00:00:00 2001 From: MichaelPlug Date: Tue, 26 Apr 2022 18:15:14 +0200 Subject: [PATCH 2/2] rename function to libraryExists() --- PythonKit/PythonLibrary.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonKit/PythonLibrary.swift b/PythonKit/PythonLibrary.swift index d17622f..0d642bb 100644 --- a/PythonKit/PythonLibrary.swift +++ b/PythonKit/PythonLibrary.swift @@ -214,7 +214,7 @@ extension PythonLibrary { PythonLibrary.Environment.library.set(path) } - public static func checkLibrary() -> Bool { + public static func libraryExists() -> Bool { let pythonLibraryHandleTest = Self.loadPythonLibrary() return Self.isPythonLibraryLoaded(at: pythonLibraryHandleTest) }