]> granicus.if.org Git - python/commitdiff
Fix SF bug #557436, TclError is a str should be an Exception
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 4 Jun 2002 17:14:07 +0000 (17:14 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 4 Jun 2002 17:14:07 +0000 (17:14 +0000)
Make Tkinter.TclError derive from Exception, it was a string.

Misc/NEWS
Modules/_tkinter.c

index 7275ad4895f9bd90817504ce10ddd739f17a0398..2004456c17912ac83993b7da3b050c618f5daeb1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -124,6 +124,10 @@ Extension modules
 
 Library
 
+- Stop using strings for exceptions.  String objects used for exceptions
+  now derive from Exception.  The objects changed were: Tkinter.TclError,
+  bdb.BdbQuit, macpath.norm_error, tabnanny.NannyNag, and xdrlib.Error.
+
 - Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
   BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
   Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
index d155e776c301bd11db7016aec11d97e630345170..788177f06e8169160a8a2d1e4404bd405a9eac3b 100644 (file)
@@ -2123,7 +2123,7 @@ init_tkinter(void)
        m = Py_InitModule("_tkinter", moduleMethods);
 
        d = PyModule_GetDict(m);
-       Tkinter_TclError = Py_BuildValue("s", "TclError");
+       Tkinter_TclError = PyErr_NewException("_tkinter.TclError", NULL, NULL);
        PyDict_SetItemString(d, "TclError", Tkinter_TclError);
 
        ins_long(d, "READABLE", TCL_READABLE);