File: python-binary

package info (click to toggle)
cppimport 22.08.02-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 260 kB
  • sloc: python: 756; cpp: 71; ansic: 31; sh: 8; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 865 bytes parent folder | download | duplicates (2)
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
From: Stefano Rivera <stefanor@debian.org>
Date: Thu, 29 Sep 2022 12:32:16 +0200
Subject: Avoid hardcoding "python" binary name

On modern Debian systems, there isn't a "python" binary, unless a user
is in a virtualenv or has installed python-is-python3.

Forwarded: https://github.com/tbenthompson/cppimport/pull/83
---
 tests/test_cppimport.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test_cppimport.py b/tests/test_cppimport.py
index f0715e3..9c12c74 100644
--- a/tests/test_cppimport.py
+++ b/tests/test_cppimport.py
@@ -38,7 +38,7 @@ def appended(filename, text):
 
 def subprocess_check(test_code, returncode=0):
     p = subprocess.run(
-        ["python", "-c", test_code],
+        [sys.executable, "-c", test_code],
         cwd=os.path.dirname(__file__),
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,