Skip to content

Commit 1db636c

Browse files
committed
Relax pycodestyle: import only allowed at the top
While this is a really good convention, sometimes one must import stuff inside a try except block. This block is still at the top, but pycodestyle treats like it isn't, because it's in an idented block, and the outeer scope.
1 parent 38894cc commit 1db636c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kubernetes/utils/create_from_yaml.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
import re
1515
import sys
1616

17-
if sys.version_info.major < 3:
18-
from StringIO import StringIO
19-
else:
20-
from io import StringIO
21-
2217
from os import path
2318

2419
import yaml
2520

2621
from kubernetes import client
2722

23+
if sys.version_info.major < 3:
24+
from StringIO import StringIO # noqa: F406
25+
else:
26+
from io import StringIO # noqa: F406
27+
2828

2929
def create_from_yaml(
3030
k8s_client,

0 commit comments

Comments
 (0)