summaryrefslogtreecommitdiff
path: root/pycodestyle.py
diff options
context:
space:
mode:
authorEric Cousineau <eric.cousineau@tri.global>2019-01-30 10:54:40 -0500
committerEric Cousineau <eric.cousineau@tri.global>2019-01-30 12:15:25 -0500
commiteba7f0f7847762bae419e366354bb30e6230daeb (patch)
treefb91d13c94efa91142bad51c126f5600df523ca7 /pycodestyle.py
parent1f8d5ca1a1ede54e6d7b67693b36b209b940573c (diff)
downloadpep8-eba7f0f7847762bae419e366354bb30e6230daeb.tar.gz
E402: Add "if" statement to allowed keywords
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-xpycodestyle.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 278bf12..68d4140 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -1067,7 +1067,8 @@ def module_imports_on_top_of_file(
line = line[1:]
return line and (line[0] == '"' or line[0] == "'")
- allowed_keywords = ('try', 'except', 'else', 'finally', 'with')
+ allowed_keywords = (
+ 'try', 'except', 'else', 'finally', 'with', 'if')
if indent_level: # Allow imports in conditional statement/function
return