             }
         }
         
-        #if canImport(Darwin)
-        if dlsym(RTLD_SELF, "Py_Initialize") != nil {
-            return RTLD_SELF
-        }
-        #endif
-        
         return nil
     }
     

            return loadPythonLibrary(at: pythonLibraryPath)
        }
        
        for majorVersion in supportedMajorVersions {
            for minorVersion in supportedMinorVersions {
                for libraryPath in libraryPaths {

// The `PythonLibrary` struct that loads Python symbols at runtime.
//===----------------------------------------------------------------------===//

var RTLD_DEFAULT = UnsafeMutableRawPointer(bitPattern: -2)

public struct PythonLibrary {
    private static let shared = PythonLibrary()
    private static let pythonLegacySymbolName = "PyString_AsString"
    private static let pythonInitializationSymbolName = "Py_Initialize"
    private static var librarySymbolsLoaded = false
    
    private let pythonLibraryHandle: UnsafeMutableRawPointer
