diff options
author | BasPH <BasPH@users.noreply.github.com> | 2019-03-27 12:19:22 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-03-27 12:19:22 +0100 |
commit | 44bbb980f30ac0d68fa5c862ac61473fdb2ab777 (patch) | |
tree | 479a1efb75b4c86fbb133a25753f0de59e1fb181 /astroid/modutils.py | |
parent | 548606af2b2d040b92f4b695f42c71117bcd1936 (diff) | |
download | astroid-git-44bbb980f30ac0d68fa5c862ac61473fdb2ab777.tar.gz |
Optimize _is_python_file check using tuple (#657)
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r-- | astroid/modutils.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py index 4e6f918f..df75a901 100644 --- a/astroid/modutils.py +++ b/astroid/modutils.py @@ -679,10 +679,7 @@ def _is_python_file(filename): .pyc and .pyo are ignored """ - for ext in (".py", ".so", ".pyd", ".pyw"): - if filename.endswith(ext): - return True - return False + return filename.endswith((".py", ".so", ".pyd", ".pyw")) def _has_init(directory): |