Skip to content

conditional import against six.PY2 emits error #3501

@georgexsh

Description

@georgexsh

Steps to reproduce

  1. Given following code
import six
if six.PY3:
    from urllib.parse import urlparse
else:
    from urlparse import urlparse
  1. run pylint with python2

Current behavior

[E0611(no-name-in-module), ] No name 'parse' in module 'urllib'

Expected behavior

no error reported

pylint --version output

Using config file .pylintrc
pylint 1.9.5,
astroid 1.6.5
Python 2.7.16 (default, Jul 12 2019, 01:42:49)
[GCC 6.3.0 20170516]

ref: #769

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions