File python_executable.patch of Package python-pysubs2
From 42655812b75c21e527dabd6460ea463f34ae23fa Mon Sep 17 00:00:00 2001
From: Alexandre Detiste <alexandre.detiste@gmail.com>
Date: Sat, 15 Feb 2025 16:16:40 +0100
Subject: [PATCH] python is "python3" on Debian (and others ?)
---
tests/test_cli.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: pysubs2-1.8.0/tests/test_cli.py
===================================================================
--- pysubs2-1.8.0.orig/tests/test_cli.py 2024-12-24 12:52:36.000000000 +0100
+++ pysubs2-1.8.0/tests/test_cli.py 2025-02-20 14:51:01.920439196 +0100
@@ -1,3 +1,4 @@
+import sys
from typing import Any
import pysubs2
@@ -49,7 +50,7 @@
def test_srt_to_microdvd_subprocess_pipe() -> None:
- cmd = ["python", "-m", "pysubs2", "--to", "microdvd", "--fps", "1000"]
+ cmd = [sys.executable, "-m", "pysubs2", "--to", "microdvd", "--fps", "1000"]
output = subprocess.check_output(cmd, input=TEST_SRT_FILE, text=True)
assert output.strip() == TEST_MICRODVD_FILE.strip()
@@ -410,7 +411,7 @@
with tempfile.TemporaryDirectory() as temp_dir:
path = op.join(temp_dir, "test.srt")
with open(path, "w+") as in_fp:
- cmd = ["python", "-m", "pysubs2"]
+ cmd = [sys.executable, "-m", "pysubs2"]
p = subprocess.run(cmd, stdin=in_fp, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
assert p.returncode == 1
assert not p.stdout.startswith("usage: pysubs2")
@@ -427,7 +428,7 @@
with open(input_path, "wb") as fp:
fp.write(input_bytes_win1250)
- cmd = ["python", "-m", "pysubs2", "-o", output_dir, input_path]
+ cmd = [sys.executable, "-m", "pysubs2", "-o", output_dir, input_path]
subprocess.check_call(cmd)
with open(output_path, "rb") as fp: