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.
This commit is contained in:
Oz N Tiram 2019-04-09 23:24:16 +02:00 committed by Oz Tiram
parent 38894cc397
commit 139848efcb
2 changed files with 7 additions and 8 deletions

View File

@ -14,5 +14,5 @@
from __future__ import absolute_import
from .create_from_yaml import (FailToCreateError, create_from_yaml,
create_from_dict)
from .create_from_yaml import (FailToCreateError, create_from_dict,
create_from_yaml)

View File

@ -13,18 +13,17 @@
# limitations under the License.
import re
import sys
if sys.version_info.major < 3:
from StringIO import StringIO
else:
from io import StringIO
from os import path
import yaml
from kubernetes import client
if sys.version_info.major < 3:
from StringIO import StringIO # noqa: F406
else:
from io import StringIO # noqa: F406
def create_from_yaml(
k8s_client,