Skip to content

Commit

Permalink
pywatch_test: fix has_py_gdb_support for el9
Browse files Browse the repository at this point in the history
On CentOS Stream 9, debuginfo packages now include the
minor version in the name, so has_py_gdb_support
logic needed some rework to support this. Otherwise,
it fails to find the gdb support package and fails
the test_timeout_backtrace.

Signed-off-by: Marcin Sobczyk <[email protected]>
Signed-off-by: Albert Esteve <[email protected]>
  • Loading branch information
aesteve-rh authored and mz-pdm committed Mar 13, 2023
1 parent 4c4a350 commit a7f8557
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/pywatch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ def has_py_gdb_support():
pkg_name = "python{}".format(sys.version_info.major)
pkg_ver = package_version(pkg_name)

# On CentOS we we don't have "python2" package and we must query "python"
# and "python-debuginfo".
if pkg_name == "python2" and not pkg_ver:
pkg_name = "python"
pkg_ver = package_version(pkg_name)

pkg_dbg_ver = package_version("{}-debuginfo".format(pkg_name))

# On CentOS Stream 9 debuginfo packages now include the minor version in
# the name, i.e. python3.9-debuginfo-...
if pkg_dbg_ver == "":
pkg_name2 = "python{}.{}".format(sys.version_info.major,
sys.version_info.minor)
pkg_dbg_ver = package_version("{}-debuginfo".format(pkg_name2))

return pkg_dbg_ver != "" and pkg_dbg_ver == pkg_ver


Expand Down

0 comments on commit a7f8557

Please sign in to comment.