Commits

Jason R. Coombs committed 87b6c72

Guard against Winvault tests if pywin32 isn't available

  • Participants
  • Parent commits 6b11ab9

Comments (0)

Files changed (1)

keyring/tests/test_backend.py

     return True
 
 def is_winvault_supported():
-    return sys.platform in ['win32'] and sys.getwindowsversion().major >= 6
+    try:
+        __import__('win32cred')
+        has_pywin32 = True
+    except ImportError:
+        has_pywin32 = False
+    return (
+        sys.platform in ['win32'] and sys.getwindowsversion().major >= 6
+        and has_pywin32
+    )
 
 def is_dbus_supported():
     try: