]> granicus.if.org Git - python/commitdiff
Another fix for Split() -- don't refuse {"} but turn it into ".
authorGuido van Rossum <guido@python.org>
Tue, 17 Dec 1996 01:25:36 +0000 (01:25 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 17 Dec 1996 01:25:36 +0000 (01:25 +0000)
This is needed because if a configure option has " as its value,
it will be rendered as {"}; after stripping one level of quoting it's
just ", on which splitlist will barf.

Modules/_tkinter.c

index 3ce0faca379eccc2c4ab8580fc8e289c3f39f1c3..1315c1b4b64657a0a80b51e88ca1991735b6f0e1 100644 (file)
@@ -255,7 +255,13 @@ Split (self, list)
     }
 
   if (Tcl_SplitList (Tkapp_Interp (self), list, &argc, &argv) == TCL_ERROR)
-    return Tkinter_Error (self);
+    {
+      /* Not a list.
+        Could be a quoted string containing funnies, e.g. {"}.
+        Return the string itself. */
+      PyErr_Clear();
+      return PyString_FromString(list);
+    }
 
   if (argc == 0)
     v = PyString_FromString ("");