From 193560790ce99061cec50869f79bdcc787ed7783 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 23 Oct 2014 03:30:23 +0100 Subject: tests: d_type-check: don't hardcode the C library name * tests/d_type-check: The hardcoded name doesn't hold true for all Linux/glibc platforms, let alone Linux/non-glibc. Use ctypes.util.find_library() instead to search for the library. --- tests/d_type-check | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/d_type-check b/tests/d_type-check index 33c1fd6d0..ff1eb60b9 100644 --- a/tests/d_type-check +++ b/tests/d_type-check @@ -5,7 +5,7 @@ import sys fail = 1 try: - import ctypes + import ctypes.util (DT_UNKNOWN, DT_DIR,) = (0, 4,) @@ -19,8 +19,7 @@ try: direntp = ctypes.POINTER(dirent) - # FIXME: find a way to avoid hard-coding libc's so-name. - libc = ctypes.cdll.LoadLibrary("libc.so.6") + libc = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True) libc.readdir.restype = direntp dirp = libc.opendir(".") -- cgit v1.2.3-54-g00ecf