]> granicus.if.org Git - python/commitdiff
Tkapp_New(): Rewrite in C so it compiles again.
authorTim Peters <tim.peters@gmail.com>
Wed, 4 Aug 2004 02:16:48 +0000 (02:16 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 4 Aug 2004 02:16:48 +0000 (02:16 +0000)
Modules/_tkinter.c

index 74fe0f8d7838e7fe03483d72d5531b64cc1a9e4c..852bde4a1134869594b5bda0c6320e235f1e9e01 100644 (file)
@@ -580,6 +580,7 @@ Tkapp_New(char *screenName, char *baseName, char *className,
 {
        TkappObject *v;
        char *argv0;
+
        v = PyObject_New(TkappObject, &Tkapp_Type);
        if (v == NULL)
                return NULL;
@@ -646,13 +647,15 @@ Tkapp_New(char *screenName, char *baseName, char *className,
 
        /* some initial arguments need to be in argv */
        if (sync || use) {
+               char *args;
                int len = 0;
+
                if (sync)
                        len += sizeof "-sync";
                if (use)
                        len += strlen(use) + sizeof "-use ";
 
-               char *args = (char*)ckalloc(len);
+               args = (char*)ckalloc(len);
                if (!args) {
                        PyErr_NoMemory();
                        Py_DECREF(v);