Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Dec 8, 2020
1 parent 3fcaf5f commit 090e6f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from typing import Optional
from typing import List, Optional

import sage
import os
Expand Down Expand Up @@ -210,7 +210,7 @@ def var(key, *fallbacks, **kwds):
var('SAGE_IMPORTALL', 'yes')


def _get_shared_lib_path(libname, *additional_libnames) -> Optional[str]:
def _get_shared_lib_path(*libnames: str) -> Optional[str]:
"""
Return the full path to a shared library file installed in
``$SAGE_LOCAL/lib`` or the directories associated with the
Expand Down Expand Up @@ -248,9 +248,9 @@ def _get_shared_lib_path(libname, *additional_libnames) -> Optional[str]:
True
"""

for libname in (libname,) + additional_libnames:
search_directories: list[Path] = []
patterns: list[str] = []
for libname in libnames:
search_directories: List[Path] = []
patterns: List[str] = []
if sys.platform == 'cygwin':
# Later down we take the first matching DLL found, so search
# SAGE_LOCAL first so that it takes precedence
Expand Down Expand Up @@ -299,7 +299,7 @@ def _get_sage_local() -> Path:
var('SINGULAR_SO', SINGULAR_SO)

# locate libgap shared object
GAP_SO = _get_shared_lib_path('gap','')
GAP_SO = _get_shared_lib_path('gap')
var('GAP_SO', GAP_SO)

# post process
Expand Down

0 comments on commit 090e6f1

Please sign in to comment.