Package: idjc Version: 0.8.7-2 Severity: normal Tags: patch upstream Usertags: l4py-except-shadows-builtin
lintian4py reports the followin issues: e: idjc: except-shadows-builtin usr/share/pyshared/idjc/freefunctions.py:55: TypeError e: idjc: except-shadows-builtin usr/share/pyshared/idjc/maingui.py:2204: IOError From the tag's description: N: One error that Python programmers occasionally make is writing the N: following code: N: N: try: N: ... N: except TypeError, ValueError: # Wrong! N: ... N: N: The author is probably trying to catch both TypeError and ValueError N: exceptions, but this code actually does something different: it will N: catch TypeError and bind the resulting exception object to the local N: name ValueError. The ValueError exception will not be caught at all. N: The correct code specifies a tuple of exceptions: N: N: try: N: ... N: except (TypeError, ValueError): N: ... N: N: Refer to N: http://docs.python.org/whatsnew/2.6.html#pep-3110-exception-handling-c N: hanges for details. Please find attached a patch to fix this issue. Regards -- Sebastian Ramacher
--- idjc-0.8.7.orig/python/freefunctions.py
+++ idjc-0.8.7/python/freefunctions.py
@@ -52,7 +52,7 @@ def url_unescape(text_in):
else:
ch = text_in[index+1:index+3].decode("hex")
skip = 2
- except IndexError,TypeError:
+ except (IndexError,TypeError):
pass
else:
ch = text_in[index]
--- idjc-0.8.7.orig/python/maingui.py
+++ idjc-0.8.7/python/maingui.py
@@ -2201,7 +2201,7 @@ class MainWindow:
try:
try:
self.mixer_write("ACTN=requestlevels\nend\n", True)
- except ValueError, IOError:
+ except (ValueError, IOError):
if locking:
gtk.gdk.threads_leave()
return True
signature.asc
Description: Digital signature

