# HG changeset patch # User Goffi # Date 1718887629 -7200 # Node ID 9308b2d15fd2b868efeefa8ff06ade0099827f58 # Parent 89a0999884ac6f39a29065bb24c111348148eb2d tools (common/async_process): accept `Path` instances as command path. diff -r 89a0999884ac -r 9308b2d15fd2 libervia/backend/tools/common/async_process.py --- a/libervia/backend/tools/common/async_process.py Thu Jun 20 14:46:55 2024 +0200 +++ b/libervia/backend/tools/common/async_process.py Thu Jun 20 14:47:09 2024 +0200 @@ -20,6 +20,7 @@ """tools to launch process in a async way (using Twisted)""" import os.path +from pathlib import Path from typing import Any from twisted.internet import defer, reactor, protocol from twisted.python.failure import Failure @@ -143,6 +144,8 @@ "to execute as first argument" ) command = args.pop(0) + if isinstance(command, Path): + command = str(command) if prot.name is None: name = os.path.splitext(os.path.basename(command))[0] prot.name = name