From ff756cbb28c4ee10651ed80f38b8ef37ee74fc39 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 6 Feb 2020 21:20:20 -0800 Subject: [PATCH] python: sort imports 202 Additional newline in a group of imports. I100 Import statements are in the wrong order. Signed-off-by: Andrei Vagin --- lib/py/images/pb2dict.py | 13 ++++++------ test/inhfd/socket.py | 2 +- test/others/rpc/config_file.py | 7 ++++--- test/zdtm.py | 38 ++++++++++++++++++---------------- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/py/images/pb2dict.py b/lib/py/images/pb2dict.py index 6fce4be22..a89850a1d 100644 --- a/lib/py/images/pb2dict.py +++ b/lib/py/images/pb2dict.py @@ -1,12 +1,13 @@ -from google.protobuf.descriptor import FieldDescriptor as FD -import opts_pb2 -from ipaddress import IPv4Address, ip_address -from ipaddress import IPv6Address -import socket +import base64 import collections import os -import base64 import quopri +import socket +from ipaddress import IPv4Address, IPv6Address, ip_address + +from google.protobuf.descriptor import FieldDescriptor as FD + +import opts_pb2 if "encodebytes" not in dir(base64): base64.encodebytes = base64.encodestring diff --git a/test/inhfd/socket.py b/test/inhfd/socket.py index 9cea16ffb..7efe7faab 100755 --- a/test/inhfd/socket.py +++ b/test/inhfd/socket.py @@ -1,5 +1,5 @@ -import socket import os +import socket def create_fds(): diff --git a/test/others/rpc/config_file.py b/test/others/rpc/config_file.py index 7b07bc145..90c80fcae 100755 --- a/test/others/rpc/config_file.py +++ b/test/others/rpc/config_file.py @@ -1,11 +1,12 @@ #!/usr/bin/python +import argparse import os import sys -import rpc_pb2 as rpc -import argparse -from tempfile import mkstemp import time +from tempfile import mkstemp + +import rpc_pb2 as rpc from setup_swrk import setup_swrk diff --git a/test/zdtm.py b/test/zdtm.py index 47c89a162..3fc57ba55 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -1,31 +1,33 @@ #!/usr/bin/env python # vim: noet ts=8 sw=8 sts=8 from __future__ import absolute_import, division, print_function, unicode_literals -from builtins import (str, open, range, zip, int, input) import argparse -import glob -import os -import subprocess -import time -import tempfile -import shutil -import re -import stat -import signal import atexit -import sys -import linecache -import random -import string -import fcntl -import errno import datetime -import yaml -import struct +import errno +import fcntl +import glob +import linecache import mmap +import os +import random +import re +import shutil +import signal +import stat +import string +import struct +import subprocess +import sys +import tempfile +import time +from builtins import (input, int, open, range, str, zip) + import pycriu as crpc +import yaml + os.chdir(os.path.dirname(os.path.abspath(__file__))) prev_line = None