diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-06-04 17:14:07 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-06-04 17:14:07 (GMT) |
commit | b5b5a260ea2e8b5ea21ec7d938ddc69ad716635e (patch) | |
tree | 4256df97fbd3b686f55a3e89f69255f56cb99e70 | |
parent | 293dd4b77b568b32d8131eebb3f6688125d117de (diff) | |
download | cpython-b5b5a260ea2e8b5ea21ec7d938ddc69ad716635e.zip cpython-b5b5a260ea2e8b5ea21ec7d938ddc69ad716635e.tar.gz cpython-b5b5a260ea2e8b5ea21ec7d938ddc69ad716635e.tar.bz2 |
Fix SF bug #557436, TclError is a str should be an Exception
Make Tkinter.TclError derive from Exception, it was a string.
-rw-r--r-- | Misc/NEWS | 4 | ||||
-rw-r--r-- | Modules/_tkinter.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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 diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index d155e77..788177f 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -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); |