Skip to content

Commit

Permalink
Add test compatibility on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 3, 2022
1 parent 107c6cf commit c397f4c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions distutils/unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def _library_root(dir):
return os.path.join(match.group(1), dir[1:]) if apply_root else dir

def find_library_file(self, dirs, lib, debug=0):
"""
r"""
Second-guess the linker with not much hard
data to go on: GCC seems to prefer the shared library, so
assume that *all* Unix C compilers do,
Expand All @@ -372,15 +372,15 @@ def find_library_file(self, dirs, lib, debug=0):
>>> monkeypatch = getfixture('monkeypatch')
>>> monkeypatch.setattr(os.path, 'exists', lambda d: 'existing' in d)
>>> dirs = ('/foo/bar/missing', '/foo/bar/existing')
>>> compiler.find_library_file(dirs, 'abc')
>>> compiler.find_library_file(dirs, 'abc').replace('\\', '/')
'/foo/bar/existing/libabc.dylib'
>>> compiler.find_library_file(reversed(dirs), 'abc')
>>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/')
'/foo/bar/existing/libabc.dylib'
>>> monkeypatch.setattr(os.path, 'exists',
... lambda d: 'existing' in d and '.a' in d)
>>> compiler.find_library_file(dirs, 'abc')
>>> compiler.find_library_file(dirs, 'abc').replace('\\', '/')
'/foo/bar/existing/libabc.a'
>>> compiler.find_library_file(reversed(dirs), 'abc')
>>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/')
'/foo/bar/existing/libabc.a'
"""
lib_names = (
Expand Down

0 comments on commit c397f4c

Please sign in to comment.