Skip to content

Commit 922ce36

Browse files
mchehabintel-lab-lkp
authored andcommitted
scripts: sphinx-pre-install: drop obsolete routines
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 30bcb9a commit 922ce36

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

scripts/sphinx-pre-install.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,6 @@ def which(prog):
114114

115115
return None
116116

117-
@staticmethod
118-
def find_python_no_venv():
119-
# FIXME: does it makes sense now that this script is in Python?
120-
121-
result = SphinxDependencyChecker.run(["pwd"], capture_output=True,
122-
text=True)
123-
cur_dir = result.stdout.strip()
124-
125-
python_names = ["python3", "python"]
126-
127-
for d in os.environ.get("PATH", "").split(":"):
128-
if f"{cur_dir}/sphinx" in d:
129-
continue
130-
131-
for p in python_names:
132-
if os.access(os.path.join(d, p), os.X_OK):
133-
return os.path.join(d, p)
134-
135-
# Python not found at the PATH
136-
return python_names[-1]
137-
138117
@staticmethod
139118
def get_python_version(cmd):
140119

@@ -940,7 +919,7 @@ def recommend_sphinx_version(self, virtualenv_cmd):
940919
else:
941920
print("\nSphinx needs to be installed either:\n1) via pip/pypi with:\n")
942921

943-
self.python_cmd = self.find_python_no_venv()
922+
self.python_cmd = os.path.abspath(sys.argv[0])
944923

945924
print(f"\t{virtualenv_cmd} {self.virtenv_dir}")
946925
print(f"\t. {self.virtenv_dir}/bin/activate")

0 commit comments

Comments
 (0)