diff --git a/lib/facter/python_release.rb b/lib/facter/python_release.rb index 5013b5c3..6255a839 100644 --- a/lib/facter/python_release.rb +++ b/lib/facter/python_release.rb @@ -2,7 +2,7 @@ def get_python_release(executable) if Facter::Util::Resolution.which(executable) # rubocop:disable Style/GuardClause - results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+)\.\d+\+?$}) + results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+)\.\d+\+?(?:rc\d+)?$}) results[1] if results end end diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb index e21723bb..0f1cf8ac 100644 --- a/lib/facter/python_version.rb +++ b/lib/facter/python_version.rb @@ -2,7 +2,7 @@ def get_python_version(executable) if Facter::Util::Resolution.which(executable) # rubocop:disable Style/GuardClause - results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+\.\d+\+?)$}) + results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+\.\d+\+?(?:rc\d+)?)$}) results[1] if results end end