Add docstring to is_import_exception

Clarify what is_import_exception does. Leave the name as
is_import_exception and no is_import_whitelisted  because
import-exceptions is part of the API for hacking (used in the hacking
section of tox.ini).

Change-Id: Ib36d84078ecfcdbcb62137b40ab7426738e56a45
This commit is contained in:
Joe Gordon 2014-12-17 13:45:12 -08:00
parent 6c851bdf2f
commit a74b044719
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ IMPORT_EXCEPTIONS += DEFAULT_IMPORT_EXCEPTIONS
def is_import_exception(mod):
"""Check module name to see if import has been whitelisted.
Import based rules should not run on any whitelisted module
"""
return (mod in IMPORT_EXCEPTIONS or
any(mod.startswith(m + '.') for m in IMPORT_EXCEPTIONS))