We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03ceef7 commit a62e7f3Copy full SHA for a62e7f3
src/_macosx.m
@@ -2531,14 +2531,23 @@ static CGFloat _get_device_scale(CGContextRef cr)
2531
"CourierNewPS-Bold-ItalicMT"},
2532
};
2533
2534
- if(!PyList_Check(family)) return 0;
+ if(!PyList_Check(family))
2535
+ {
2536
+ PyErr_SetString(PyExc_ValueError, "family should be a list");
2537
+ return 0;
2538
+ }
2539
n = PyList_GET_SIZE(family);
2540
2541
for (i = 0; i < n; i++)
2542
{
2543
PyObject* item = PyList_GET_ITEM(family, i);
2544
ascii = PyUnicode_AsASCIIString(item);
- if(!ascii) return 0;
2545
+ if(!ascii)
2546
2547
+ PyErr_SetString(PyExc_ValueError,
2548
+ "failed to convert font family name to ASCII");
2549
2550
2551
temp = PyBytes_AS_STRING(ascii);
2552
for (j = 0; j < NMAP; j++)
2553
{ if (!strcmp(map[j].name, temp))
0 commit comments