FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

simplified TryGetDllFromGetLibPathsOutput · losttech/WhichPython@fe18a7e · GitHub

Repository navigation

Commit fe18a7e

Browse files
committed
simplified TryGetDllFromGetLibPathsOutput
1 parent 34169c4 commit fe18a7e

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

‎src/PythonEnvironment.cs‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,11 @@ static string LocateSo(FileInfo interpreterPath) {
347347
string[] paths = stdout
348348
.Split(new[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
349349
.ToArray();
350-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
351-
if (paths.Length == 1) {
352-
string so = Path.ChangeExtension(paths[0], DynamicLibraryExtension);
353-
return File.Exists(so) ? so : paths[0];
354-
}
355-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
356-
return paths.Select(libPath => Path.ChangeExtension(libPath, ".dylib"))
357-
.FirstOrDefault(File.Exists);
358-
}
359350

360-
return null;
351+
return paths.Select(libPath => Path.ChangeExtension(libPath, DynamicLibraryExtension))
352+
.Concat(paths)
353+
.Where(libPath => Path.GetExtension(libPath) != ".a")
354+
.FirstOrDefault(File.Exists);
361355
}
362356

363357
static DirectoryInfo? TryGuessUnixHome(FileInfo interpreterPath, Version version, string dllPath) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL