mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-28 16:50:01 +02:00
auto prepend python binary to args when running system command with python file as first argument
This commit is contained in:
@@ -14,7 +14,7 @@ from crontab import CronTab
|
|||||||
from .vendor.atomicwrites import atomic_write as lib_atomic_write
|
from .vendor.atomicwrites import atomic_write as lib_atomic_write
|
||||||
|
|
||||||
from .util import enforce_types, ExtendedEncoder
|
from .util import enforce_types, ExtendedEncoder
|
||||||
from .config import OUTPUT_PERMISSIONS
|
from .config import PYTHON_BINARY, OUTPUT_PERMISSIONS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +37,9 @@ def run(*args, input=None, capture_output=True, timeout=None, check=False, text=
|
|||||||
|
|
||||||
pgid = None
|
pgid = None
|
||||||
try:
|
try:
|
||||||
|
if args[0].endswith('.py'):
|
||||||
|
args = (PYTHON_BINARY, *args)
|
||||||
|
|
||||||
with Popen(*args, start_new_session=start_new_session, **kwargs) as process:
|
with Popen(*args, start_new_session=start_new_session, **kwargs) as process:
|
||||||
pgid = os.getpgid(process.pid)
|
pgid = os.getpgid(process.pid)
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user