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:
parent
38894cc397
commit
139848efcb
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user