HRESULT has moved from wintypes in python 3.8

This commit is contained in:
Kovid Goyal 2019-12-04 09:30:38 +05:30
parent f615b44ace
commit 860bcf0088
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1471,12 +1471,13 @@ empty_index = empty_model.index(0)
def set_app_uid(val): def set_app_uid(val):
import ctypes import ctypes
from ctypes import wintypes from ctypes import wintypes
from ctypes import HRESULT
try: try:
AppUserModelID = ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID AppUserModelID = ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID
except Exception: # Vista has no app uids except Exception: # Vista has no app uids
return False return False
AppUserModelID.argtypes = [wintypes.LPCWSTR] AppUserModelID.argtypes = [wintypes.LPCWSTR]
AppUserModelID.restype = wintypes.HRESULT AppUserModelID.restype = HRESULT
try: try:
AppUserModelID(unicode_type(val)) AppUserModelID(unicode_type(val))
except Exception as err: except Exception as err: