# HG changeset patch # User Alain Leufroy # Date 1672856915 -3600 # Wed Jan 04 19:28:35 2023 +0100 # Node ID bbdffce563aac1e984178cafc441f0553800de05 # Parent 4f6ced862c4e2bb897c3e530454ebee94fc6059f process.py: fix python 3.10 compat See https://docs.python.org/3/whatsnew/3.10.html#removed "The loop parameter has been removed from most of asyncio‘s high-level API" diff --git a/lairucrem/process.py b/lairucrem/process.py --- a/lairucrem/process.py +++ b/lairucrem/process.py @@ -9,11 +9,12 @@ import os import shlex import sys +from sys import version_info from typing import AsyncIterable from . import config, get_extension_path, interrupt_mainloop from .config import get_hg -from .exceptions import HgNotFoundError, RepositoryNotFound, CriticalError +from .exceptions import CriticalError, HgNotFoundError, RepositoryNotFound # @@ -75,9 +76,12 @@ args += ('--traceback',) args += self.args self.cmd = ' '.join(shlex.quote(a) for a in args) + kwargs = self.kwargs.copy() + if version_info[:2] < (3, 10): + kwargs['loop'] = asyncio.get_event_loop() try: self.proc = await asyncio.create_subprocess_exec( - *args, loop=asyncio.get_event_loop(), **self.kwargs + *args, **self.kwargs ) except FileNotFoundError as exc: raise HgNotFoundError() from exc