]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed getargs() call in setfont.
authorGuido van Rossum <guido@python.org>
Wed, 5 Feb 1992 11:15:00 +0000 (11:15 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 5 Feb 1992 11:15:00 +0000 (11:15 +0000)
Improved setwincursor() to allow None to explicitly turn the cursor off.

Modules/stdwinmodule.c

index 5556f031a8ba62fdbdfa4f9affd9f1a87e7a6dc8..d3ecfb87d8794006fdb4376edbf08aff9b0e702a 100644 (file)
@@ -612,7 +612,7 @@ drawing_setfont(self, args)
        char style = '\0';
        int size = 0;
        if (args == NULL || !is_tupleobject(args)) {
-               if (!getargs(args, "z", font))
+               if (!getargs(args, "z", &font))
                        return NULL;
        }
        else {
@@ -1596,12 +1596,16 @@ window_setwincursor(self, args)
 {
        char *name;
        CURSOR *c;
-       if (!getstrarg(args, &name))
-               return NULL;
-       c = wfetchcursor(name);
-       if (c == NULL) {
-               err_setstr(StdwinError, "no such cursor");
+       if (!getargs(args, "z", &name))
                return NULL;
+       if (name == NULL)
+               c = NULL;
+       else {
+               c = wfetchcursor(name);
+               if (c == NULL) {
+                       err_setstr(StdwinError, "no such cursor");
+                       return NULL;
+               }
        }
        wsetwincursor(self->w_win, c);
        INCREF(None);