Package: ruby-pygments.rb / 1.2.0-4

0006-Invoke-mentos-directly-on-GNU-Linux.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Per Andersson <avtobiff@gmail.com>
Date: Wed, 2 Apr 2014 23:30:58 +0200
Subject: Invoke mentos directly on GNU/Linux

Invoking the script on GNU/Linux by passing it as an argument to
python(2) makes the process use 100% CPU for about tens of seconds when
it is supposed to timeout (test_returns_nil_on_timeout reproduces this).

On current Debian Sid python2 exists, so this can be used in mentos.py
shebang.

Brought back script invocation for windows.

This is forwarded upstream https://github.com/tmm1/pygments.rb/pull/119
---
 lib/pygments/popen.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/pygments/popen.rb b/lib/pygments/popen.rb
index a0ed512..56544f4 100644
--- a/lib/pygments/popen.rb
+++ b/lib/pygments/popen.rb
@@ -41,7 +41,8 @@ module Pygments
 
       # A pipe to the mentos python process. #popen4 gives us
       # the pid and three IO objects to write and read.
-      script = "#{python_binary} #{File.expand_path('../mentos.py', __FILE__)}"
+      script = "#{File.expand_path('../mentos.py', __FILE__)}"
+      script = "#{python_binary} "  + script if windows?
       @pid, @in, @out, @err = popen4(script)
       @log.info "Starting pid #{@pid} with fd #{@out.to_i} and python #{python_binary}."
     end