← Back to team overview

divmod-dev team mailing list archive

[Bug 916264] Re: Cascading try/except imports report duplicates

 

The same duplication warning occurs if one assigns the import name, like
in:

try:
    import signal
except ImportError:
    signal = None

This code comes from a program which sometimes runs under Jython, so it
could quickly test if "signal" was available.

François

-- 
You received this bug notification because you are a member of Divmod-
dev, which is the registrant for Pyflakes.
https://bugs.launchpad.net/bugs/916264

Title:
  Cascading try/except imports report duplicates

Status in Pyflakes:
  New

Bug description:
  With the attached example file, pyflakes reports

  pf.py:6: redefinition of unused 'connect' from line 3
  pf.py:6: redefinition of unused 'PARSE_DECLTYPES' from line 3
  pf.py:6: redefinition of unused 'PARSE_COLNAMES' from line 3

  They're not redefinitions, but fallbacks in case defining them the
  first time fails.  I don't know if there's a way to catch this, but
  it's worth noting.

To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/916264/+subscriptions


References