Comment 3 for bug 1162031

Revision history for this message
Florent (florent.x) wrote :

In the "import as" example, the name "selenium" is assigned in the global namespace but it is not used in the module. Only "se" is effectively used.
In the other example, the "selenium" name is assigned and is effectively used.

There are different ways to work around this and avoid putting an unused name in the globals. For example:

  from selenium import webdriver
  webdriver.Firefox("foo")

Or another example:

  import selenium as se
  __import__('selenium.webdriver')
  se.webdriver.Firefox("foo")

Or you keep the code as-is, and you just ignore this pyflakes message.