From 8dd4a329e6f33eafe565ad526b9c5de4234afda1 Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Mon, 11 Oct 2021 21:00:37 +0530 Subject: [PATCH] Updated import placement based on python version dependencies --- src/depends.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/depends.py b/src/depends.py index 48d9daf0..85f66f0f 100755 --- a/src/depends.py +++ b/src/depends.py @@ -5,9 +5,7 @@ and suggest how it may be installed import os import re -import subprocess import sys -from importlib import import_module # Only really old versions of Python don't have sys.hexversion. We don't # support them. The logging module was introduced in Python 2.3 @@ -19,6 +17,9 @@ if not hasattr(sys, 'hexversion') or sys.hexversion < 0x20300F0: ) import logging # noqa:E402 +import subprocess + +from importlib import import_module # We can now use logging so set up a simple configuration formatter = logging.Formatter('%(levelname)s: %(message)s')