[issue15313] IDLE - remove all bare excepts

Roger Serwy report at bugs.python.org
Tue Jul 10 07:18:47 CEST 2012


Roger Serwy <roger.serwy at gmail.com> added the comment:

Line 1245 is part of this code (in time, these line numbers will change.)

        try:
            self.text.mark_gravity("iomark", "right")
            OutputWindow.write(self, s, tags, "iomark")
            self.text.mark_gravity("iomark", "left")
        except:
            raise ###pass  # ### 11Aug07 KBK if we are expecting exceptions
                           # let's find out what they are and be specific.
   

The delegator chain that sits between OutputWindow.write and the Tkinter text.insert method can raise any error. (The ColorDelegator would raise a TypeError when "s" was not a string). I'd rather not replace this with "except Exception:" since the delegators should catch their own errors. 

I suggest removing this try/catch block.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15313>
_______________________________________


More information about the Python-bugs-list mailing list