This is an automated email from the ASF dual-hosted git repository.

sebbASF pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new b3e9ac19 No need to involve shell here
b3e9ac19 is described below

commit b3e9ac1955ffa9b389b6bf78de5e5c95f082f1ca
Author: Sebb <[email protected]>
AuthorDate: Tue Aug 11 15:20:24 2026 +0100

    No need to involve shell here
---
 tools/whatif.rb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/whatif.rb b/tools/whatif.rb
index bc0fa653..e95517c7 100755
--- a/tools/whatif.rb
+++ b/tools/whatif.rb
@@ -51,6 +51,7 @@
 MEETINGS  = File.expand_path('../Meetings') unless defined? MEETINGS
 WHATIF = './whatif.py' unless defined? WHATIF
 
+require 'open3'
 require 'wunderbar'
 require 'tempfile'
 
@@ -69,9 +70,7 @@ def ini(vote)
 end
 
 def filtered_election(votes, seats, candidates)
-  list = candidates.join(' ')
-
-  output = `#{WHATIF} #{votes} #{seats} #{list}`
+  output, _stderr, _rc = Open3.capture3(WHATIF, votes, seats, *candidates)
   output.scan(/.*elected$/).inject(Hash.new('none')) do |results, line|
     name, status = line.scan(/^(.*?)\s+(n?o?t?\s?elected)$/).flatten
     results.merge({name.gsub(/[^[[:alnum:]]]/,'') => status.gsub(/\s/, '-')})

Reply via email to