Skip to content

Commit

Permalink
TST: try Cygwin fix, no curdir on nt
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Oct 29, 2024
1 parent 83675d1 commit c505374
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/packages/sharedlib-in-package/mypkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: MIT

import os
import sys


def _enable_sharedlib_loading():
Expand All @@ -21,9 +22,12 @@ def _enable_sharedlib_loading():
with `ctypes.WinDLL` may be preferred (the SciPy code base has an
example of this).
"""
if os.name == "nt":
if os.name == "NOnt":
basedir = os.path.dirname(__file__)
os.add_dll_directory(basedir)
elif sys.platform == "cygwin":
basedir = os.path.dirname(__file__)
os.environ["PATH"] = f"{os.environ['PATH']:s}:{basedir:s}"


_enable_sharedlib_loading()
Expand Down

0 comments on commit c505374

Please sign in to comment.