Skip to content

Commit 82c0c17

Browse files
committed
Utils: drop _find_xml_generator_for_legacy_python
We do not support version below Python 3.7
1 parent 2d23294 commit 82c0c17

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

src/pygccxml/utils/utils.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,12 @@ def find_xml_generator(name="castxml", search_path=None):
5050
5151
"""
5252

53-
if sys.version_info[:2] >= (3, 3):
54-
path = _find_xml_generator_for_python_greater_equals_33(
55-
name, search_path=search_path)
56-
else:
57-
path = _find_xml_generator_for_legacy_python(name)
58-
53+
path = shutil.which(name, path=search_path)
5954
if path == "" or path is None:
6055
raise Exception("No c++ parser found. Please install castxml.")
6156
return path.rstrip(), name
6257

6358

64-
def _find_xml_generator_for_python_greater_equals_33(name, search_path=None):
65-
return shutil.which(name, path=search_path)
66-
67-
68-
def _find_xml_generator_for_legacy_python(name):
69-
if platform.system() == "Windows":
70-
command = "where"
71-
else:
72-
command = "which"
73-
p = subprocess.Popen([command, name], stdout=subprocess.PIPE,
74-
stderr=subprocess.PIPE)
75-
path = p.stdout.read().decode("utf-8")
76-
p.wait()
77-
p.stdout.close()
78-
p.stderr.close()
79-
return path.rstrip()
80-
81-
8259
def _create_logger_(name):
8360
"""Implementation detail, creates a logger."""
8461
logger = logging.getLogger(name)

0 commit comments

Comments
 (0)