summaryrefslogtreecommitdiff
path: root/pycodestyle.py
diff options
context:
space:
mode:
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