Issue #738 resolved

Misspelled except statement shadows builtin KeyError exception

Anonymous created an issue

A misspelled except statement shadows the buildin exception !KeyError. The error is in the _cplogging module and could be fixed using this patch:

{{{

diff -u _cplogging.py.old _cplogging.py --- _cplogging.py.old 2007-10-05 16:36:25.000000000 +0200 +++ _cplogging.py 2007-10-05 16:36:54.000000000 +0200 @@ -188,7 +188,7 @@ """Flushes the stream.""" try: stream = cherrypy.request.wsgi_environ.get('wsgi.errors') - except AttributeError, KeyError: + except (AttributeError, KeyError): pass else: stream.flush() @@ -197,7 +197,7 @@ """Emit a record.""" try: stream = cherrypy.request.wsgi_environ.get('wsgi.errors') - except AttributeError, KeyError: + except (AttributeError, KeyError): pass else: try: }}}

Regards, Carsten

Reported by Carsten Grohmann <carstengrohmann _ gmx.de>

Comments (2)

  1. Log in to comment