Skip to content

Commit e1a3d06

Browse files
script/cpatch.py: add support for multiple valid python versions
Fix running cpatch.py with the latest centos9s based container images. Future proof a little by adding multiple valid, existing, python version numbers to probe. Signed-off-by: John Mulligan <[email protected]>
1 parent 324cbc9 commit e1a3d06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/script/cpatch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ def _py_site_packages(self):
549549
if self._cached_py_site_packages is not None:
550550
return self._cached_py_site_packages
551551
# use the container image to probe for the correct python site-packages dir
552+
py_vers = ['3.12', '3.11', '3.10', '3.9', '3.8', '3.6']
552553
valid_site_packages = [
553-
"/usr/lib/python3.8/site-packages",
554-
"/usr/lib/python3.6/site-packages",
554+
f'/usr/lib/python{v}/site-packages' for v in py_vers
555555
]
556556
cmd = [
557557
self._ctx.engine,

0 commit comments

Comments
 (0)