divmod-dev team mailing list archive
-
divmod-dev team
-
Mailing list archive
-
Message #00170
[Bug 848455] Re: Detect misuse of except
You only get the unused-local-variable warning if the try/except is in a
function. However, it looks like pyflakes does not warn about shadowing
builtins, which I thought it did, so my analysis in the description is
probably wrong.
--
You received this bug notification because you are a member of Divmod-
dev, which is the registrant for Pyflakes.
https://bugs.launchpad.net/bugs/848455
Title:
Detect misuse of except
Status in Pyflakes:
New
Status in “pyflakes” package in Debian:
Confirmed
Bug description:
It would be nice if pyflakes could detect mistakes like this:
try:
oldtime = os.path.getmtime(fname)
except OSError, IOError:
oldtime = 0
In the general case, it's obviously difficult to tell whether this is
an error or not; but I suspect that handling the exception variable
name as a binding would give you a "redefinition of Foo" warning in
most of the cases where a mistake has been made.
To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/848455/+subscriptions
References