diff --git a/comtypes/test/test_safearray_pywin32.py b/comtypes/test/test_safearray_pywin32.py index 638195ab9..44567c5c4 100644 --- a/comtypes/test/test_safearray_pywin32.py +++ b/comtypes/test/test_safearray_pywin32.py @@ -4,20 +4,20 @@ from comtypes.automation import VARIANT +try: + import pythoncom + # pywin32 is available. The pythoncom dll contains two handy + # exported functions that allow to create a VARIANT from a Python + # object, also a function that unpacks a VARIANT into a Python + # object. + # + # This allows us to create und unpack SAFEARRAY instances + # contained in VARIANTs, and check for consistency with the + # comtypes code. +except ImportError: + # pywin32 not installed... + raise unittest.SkipTest("This depends on 'pywin32'.") -raise unittest.SkipTest("This depends on 'pywin32'.") - -import pythoncom -# pywin32 not installed... - -# pywin32 is available. The pythoncom dll contains two handy -# exported functions that allow to create a VARIANT from a Python -# object, also a function that unpacks a VARIANT into a Python -# object. -# -# This allows us to create und unpack SAFEARRAY instances -# contained in VARIANTs, and check for consistency with the -# comtypes code. _dll = PyDLL(pythoncom.__file__)