]> granicus.if.org Git - python/commitdiff
Avoid warnings in the test suite because ctypes.wintypes cannot be
authorThomas Heller <theller@ctypes.org>
Fri, 12 Jan 2007 20:08:19 +0000 (20:08 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 12 Jan 2007 20:08:19 +0000 (20:08 +0000)
imported on non-windows systems.

Lib/ctypes/test/test_win32.py

index d6f018bd68af48b2f609e9146d52a1eeea04a76b..057873c57e62213a271302b763530b8bd2071d6c 100644 (file)
@@ -3,7 +3,6 @@
 from ctypes import *
 from ctypes.test import is_resource_enabled
 import unittest, sys
-from ctypes import wintypes
 
 import _ctypes_test
 
@@ -49,9 +48,11 @@ if sys.platform == "win32":
 
     class TestWintypes(unittest.TestCase):
         def test_HWND(self):
+            from ctypes import wintypes
             self.failUnlessEqual(sizeof(wintypes.HWND), sizeof(c_void_p))
 
         def test_PARAM(self):
+            from ctypes import wintypes
             self.failUnlessEqual(sizeof(wintypes.WPARAM),
                                  sizeof(c_void_p))
             self.failUnlessEqual(sizeof(wintypes.LPARAM),