Skip to content

Name already defined when importing in try ... except #2556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ilevkivskyi opened this issue Dec 12, 2016 · 1 comment
Closed

Name already defined when importing in try ... except #2556

ilevkivskyi opened this issue Dec 12, 2016 · 1 comment

Comments

@ilevkivskyi
Copy link
Member

If I write:

try:
    import collections.abc as collections_abc
except ImportError:
    import collections as collections_abc

Then I get:

Name 'collections_abc' already defined

This is similar to what happens in conditional class definition in #1874

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 12, 2016

This is a duplicate of #1153.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants