]> granicus.if.org Git - python/commitdiff
Very simple test for ctypes.util.find_library on Windows.
authorThomas Heller <theller@ctypes.org>
Fri, 16 May 2008 20:19:07 +0000 (20:19 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 16 May 2008 20:19:07 +0000 (20:19 +0000)
Lib/ctypes/test/test_loading.py

index 4b950291d4cdd2d028c2355a00396d00ddb59282..712b650ea4100399e0ba8c44ac7b4200f837548c 100644 (file)
@@ -6,7 +6,7 @@ from ctypes.test import is_resource_enabled
 
 libc_name = None
 if os.name == "nt":
-    libc_name = "msvcrt"
+    libc_name = find_library("c")
 elif os.name == "ce":
     libc_name = "coredll"
 elif sys.platform == "cygwin":
@@ -43,6 +43,7 @@ class LoaderTest(unittest.TestCase):
 
     if os.name in ("nt", "ce"):
         def test_load_library(self):
+            self.failIf(libc_name is None)
             if is_resource_enabled("printing"):
                 print find_library("kernel32")
                 print find_library("user32")