Skip to content

Commit 10dadd8

Browse files
authored
Merge pull request #169 from iMichka/shutil
Utils: drop _find_xml_generator_for_legacy_python
2 parents 156941f + 82c0c17 commit 10dadd8

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
@@ -55,35 +55,12 @@ def find_xml_generator(name="castxml", search_path=None):
5555
5656
"""
5757

58-
if sys.version_info[:2] >= (3, 3):
59-
path = _find_xml_generator_for_python_greater_equals_33(
60-
name, search_path=search_path)
61-
else:
62-
path = _find_xml_generator_for_legacy_python(name)
63-
58+
path = shutil.which(name, path=search_path)
6459
if path == "" or path is None:
6560
raise Exception("No c++ parser found. Please install castxml.")
6661
return path.rstrip(), name
6762

6863

69-
def _find_xml_generator_for_python_greater_equals_33(name, search_path=None):
70-
return shutil.which(name, path=search_path)
71-
72-
73-
def _find_xml_generator_for_legacy_python(name):
74-
if platform.system() == "Windows":
75-
command = "where"
76-
else:
77-
command = "which"
78-
p = subprocess.Popen([command, name], stdout=subprocess.PIPE,
79-
stderr=subprocess.PIPE)
80-
path = p.stdout.read().decode("utf-8")
81-
p.wait()
82-
p.stdout.close()
83-
p.stderr.close()
84-
return path.rstrip()
85-
86-
8764
def _create_logger_(name):
8865
"""Implementation detail, creates a logger."""
8966
logger = logging.getLogger(name)

0 commit comments

Comments
 (0)