diff options
author | Eric Cousineau <eric.cousineau@tri.global> | 2019-09-25 18:08:10 -0400 |
---|---|---|
committer | Eric Cousineau <eric.cousineau@tri.global> | 2019-09-25 18:10:46 -0400 |
commit | dd6268c488ec6ab23188f31f7a1d345a8e114cbe (patch) | |
tree | 0affce1d83e7b51ca41e12c72b768030b885073a | |
parent | eba7f0f7847762bae419e366354bb30e6230daeb (diff) | |
download | pep8-dd6268c488ec6ab23188f31f7a1d345a8e114cbe.tar.gz |
E402: Add "elif" statement to allowed keywords
-rwxr-xr-x | pycodestyle.py | 2 | ||||
-rw-r--r-- | testsuite/E40.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 68d4140..e339d72 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -1068,7 +1068,7 @@ def module_imports_on_top_of_file( return line and (line[0] == '"' or line[0] == "'") allowed_keywords = ( - 'try', 'except', 'else', 'finally', 'with', 'if') + 'try', 'except', 'else', 'finally', 'with', 'if', 'elif') if indent_level: # Allow imports in conditional statement/function return diff --git a/testsuite/E40.py b/testsuite/E40.py index 041ffb3..6c71fa2 100644 --- a/testsuite/E40.py +++ b/testsuite/E40.py @@ -43,6 +43,10 @@ import bar #: Okay if False: import foo +elif not True: + import bar +else: + import mwahaha import bar #: E402 |