File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2531,14 +2531,23 @@ static CGFloat _get_device_scale(CGContextRef cr)
2531
2531
"CourierNewPS-Bold-ItalicMT"},
2532
2532
};
2533
2533
2534
- if(!PyList_Check(family)) return 0;
2534
+ if(!PyList_Check(family))
2535
+ {
2536
+ PyErr_SetString(PyExc_ValueError, "family should be a list");
2537
+ return 0;
2538
+ }
2535
2539
n = PyList_GET_SIZE(family);
2536
2540
2537
2541
for (i = 0; i < n; i++)
2538
2542
{
2539
2543
PyObject* item = PyList_GET_ITEM(family, i);
2540
2544
ascii = PyUnicode_AsASCIIString(item);
2541
- if(!ascii) return 0;
2545
+ if(!ascii)
2546
+ {
2547
+ PyErr_SetString(PyExc_ValueError,
2548
+ "failed to convert font family name to ASCII");
2549
+ return 0;
2550
+ }
2542
2551
temp = PyBytes_AS_STRING(ascii);
2543
2552
for (j = 0; j < NMAP; j++)
2544
2553
{ if (!strcmp(map[j].name, temp))
You can’t perform that action at this time.
0 commit comments