8000 Relax pycodestyle: import only allowed at the top · abhinavcoder/python@139848e · GitHub
[go: up one dir, main page]

Skip to content

Commit 139848e

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 139848e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

kubernetes/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
from __future__ import absolute_import
1616

17-
from .create_from_yaml import (FailToCreateError, create_from_yaml,
18-
create_from_dict)
17+
from .create_from_yaml import (FailToCreateError, create_from_dict,
18+
create_from_yaml)

kubernetes/utils/create_from_yaml.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@
1313
# limitations under the License.
1414
import re
1515
import sys
16-
17-
if sys.version_info.major < 3:
18-
from StringIO import StringIO
19-
else:
20-
from io import StringIO
21-
2216
from os import path
2317

2418
import yaml
2519

2620
from kubernetes import client
2721

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

2928
def create_from_yaml(
3029
k8s_client,

0 commit comments

Comments
 (0)
0