mirror of https://github.com/python/cpython
Fixed getargs() call in setfont.
Improved setwincursor() to allow None to explicitly turn the cursor off.
This commit is contained in:
parent
862c6f1046
commit
3c8ba7a1ea
|
@ -612,7 +612,7 @@ drawing_setfont(self, args)
|
||||||
char style = '\0';
|
char style = '\0';
|
||||||
int size = 0;
|
int size = 0;
|
||||||
if (args == NULL || !is_tupleobject(args)) {
|
if (args == NULL || !is_tupleobject(args)) {
|
||||||
if (!getargs(args, "z", font))
|
if (!getargs(args, "z", &font))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1596,13 +1596,17 @@ window_setwincursor(self, args)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
CURSOR *c;
|
CURSOR *c;
|
||||||
if (!getstrarg(args, &name))
|
if (!getargs(args, "z", &name))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (name == NULL)
|
||||||
|
c = NULL;
|
||||||
|
else {
|
||||||
c = wfetchcursor(name);
|
c = wfetchcursor(name);
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
err_setstr(StdwinError, "no such cursor");
|
err_setstr(StdwinError, "no such cursor");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
wsetwincursor(self->w_win, c);
|
wsetwincursor(self->w_win, c);
|
||||||
INCREF(None);
|
INCREF(None);
|
||||||
return None;
|
return None;
|
||||||
|
|
Loading…
Reference in New Issue