From 82c0c1753be07d3466abd1e42abcc8dee5c5c814 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Mon, 21 Aug 2023 22:28:47 +0200 Subject: [PATCH] Utils: drop _find_xml_generator_for_legacy_python We do not support version below Python 3.7 --- src/pygccxml/utils/utils.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/pygccxml/utils/utils.py b/src/pygccxml/utils/utils.py index 21bb5d3c..d01e36cc 100644 --- a/src/pygccxml/utils/utils.py +++ b/src/pygccxml/utils/utils.py @@ -50,35 +50,12 @@ def find_xml_generator(name="castxml", search_path=None): """ - if sys.version_info[:2] >= (3, 3): - path = _find_xml_generator_for_python_greater_equals_33( - name, search_path=search_path) - else: - path = _find_xml_generator_for_legacy_python(name) - + path = shutil.which(name, path=search_path) if path == "" or path is None: raise Exception("No c++ parser found. Please install castxml.") return path.rstrip(), name -def _find_xml_generator_for_python_greater_equals_33(name, search_path=None): - return shutil.which(name, path=search_path) - - -def _find_xml_generator_for_legacy_python(name): - if platform.system() == "Windows": - command = "where" - else: - command = "which" - p = subprocess.Popen([command, name], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - path = p.stdout.read().decode("utf-8") - p.wait() - p.stdout.close() - p.stderr.close() - return path.rstrip() - - def _create_logger_(name): """Implementation detail, creates a logger.""" logger = logging.getLogger(name)