mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
refactoring
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
|
||||
|
||||
import asyncio
|
||||
import signal
|
||||
import pwd
|
||||
|
||||
from typing import Dict
|
||||
@@ -30,6 +29,8 @@ from typing import Optional
|
||||
|
||||
import pytest
|
||||
|
||||
from kvmd import aioproc
|
||||
|
||||
from . import get_configured_auth_service
|
||||
|
||||
|
||||
@@ -44,7 +45,7 @@ async def _run_process(cmd: str, input: Optional[str]=None) -> None: # pylint:
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
*cmd.split(" "),
|
||||
stdin=(asyncio.subprocess.PIPE if input is not None else None),
|
||||
preexec_fn=(lambda: signal.signal(signal.SIGINT, signal.SIG_IGN)),
|
||||
preexec_fn=aioproc.preexec_ignore_sigint,
|
||||
)
|
||||
await proc.communicate(input.encode() if input is not None else None)
|
||||
assert proc.returncode == 0
|
||||
|
||||
Reference in New Issue
Block a user