Open
Description
For all bugs, please provide the following information:
Expected behavior and actual behavior
Calling SetCustomColors
should raise a descriptive exception, namely: TypeError: The argument must be a sequence of integers of length 1-16
. But instead you get SystemError: error return without exception set
.
pywin32/Pythonwin/win32dlg.cpp
Lines 1292 to 1309 in 8258348
Steps to reproduce the problem
import win32ui
win32ui.CreateColorDialog(0, 0).SetCustomColors() # SystemError: error return without exception set
win32ui.CreateColorDialog(0, 0).SetCustomColors([]) # SystemError: error return without exception set
win32ui.CreateColorDialog(0, 0).SetCustomColors([0]) # OK
win32ui.CreateColorDialog(0, 0).SetCustomColors((0,0)) # OK
win32ui.CreateColorDialog(0, 0).SetCustomColors((0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)) # SystemError: error return without exception set
System information
Python version and distribution: 3.10.11
pywin32 version: 310
Windows Version: 10.0.19045 Build 19045
DLL locations: N/A