[code-quality] [feature request] Unused variable warning for "except Exception as e"

Shane Creighton-Young shane at goubiq.com
Mon Apr 16 09:47:20 EDT 2018


Hi Ian,

I am running python 3.6.4 and pyflakes 1.6.0 via flake8 3.5.0.

On Sun, Apr 15, 2018 at 9:11 PM, Ian Stapleton Cordasco <
graffatcolmingov at gmail.com> wrote:

> Hi Shane,
>
> Can you share what version of pyflakes and on what version of python
> you're running?
>
> For future reference, I think the preferred location for ideas and bugs is
> github.com/PyCQA/pyflakes/issues
>
> Sent from my phone with my typo-happy thumbs. Please excuse my brevity
>
> On Sun, Apr 15, 2018, 20:09 Shane Creighton-Young <shane at goubiq.com>
> wrote:
>
>> Hello flake8!
>>
>> I would have expected pyflakes to emit an unused variables warning for
>> "e" on the following code snippet:
>>
>> class ModuleError(Exception):
>>     pass
>>
>> try:
>>     1 / 0
>> except ZeroDivisionError as e:
>>     raise ModuleError()
>>
>> Curious if this check can be added.
>>
>> Thank you!
>>
>> --
>> Shane Creighton-Young
>> shane at goubiq.com
>>
>> _______________________________________________
>> code-quality mailing list
>> code-quality at python.org
>> https://mail.python.org/mailman/listinfo/code-quality
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20180416/d7f0b601/attachment.html>


More information about the code-quality mailing list