Skip to content

Commit 7db97d6

Browse files
committed
3.6.1 - Improve keyboard interrupt handling
1 parent c5392cb commit 7db97d6

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
7777
- run: |
7878
mk python-release owner=libre-embedded \
79-
repo=vcorelib version=3.6.0
79+
repo=vcorelib version=3.6.1
8080
if: |
8181
matrix.python-version == '3.12'
8282
&& matrix.system == 'ubuntu-latest'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
=====================================
33
generator=datazen
44
version=3.2.0
5-
hash=40a79b61e984fa4e38232c2a6632295e
5+
hash=cabc70daac83874945f038528b4c4fc7
66
=====================================
77
-->
88

9-
# vcorelib ([3.6.0](https://pypi.org/project/vcorelib/))
9+
# vcorelib ([3.6.1](https://pypi.org/project/vcorelib/))
1010

1111
[![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
1212
![Build Status](https://github.com/libre-embedded/vcorelib/workflows/Python%20Package/badge.svg)

local/variables/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
major: 3
33
minor: 6
4-
patch: 0
4+
patch: 1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
44

55
[project]
66
name = "vcorelib"
7-
version = "3.6.0"
7+
version = "3.6.1"
88
description = "A collection of core Python utilities."
99
readme = "README.md"
1010
requires-python = ">=3.12"

vcorelib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# =====================================
22
# generator=datazen
33
# version=3.2.0
4-
# hash=ad4ebe9217efd823fdd7b55bb9d72258
4+
# hash=5c5ca97d979a16d96ecb00f31c1bc21e
55
# =====================================
66

77
"""
@@ -10,7 +10,7 @@
1010

1111
DESCRIPTION = "A collection of core Python utilities."
1212
PKG_NAME = "vcorelib"
13-
VERSION = "3.6.0"
13+
VERSION = "3.6.1"
1414

1515
# vcorelib-specific content.
1616
DEFAULT_INDENT = 2

vcorelib/asyncio/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from contextlib import suppress as _suppress
99
from logging import getLogger as _getLogger
1010
import signal as _signal
11+
import time as _time
1112
from types import FrameType as _FrameType
1213
from typing import Any as _Any
1314
from typing import Awaitable as _Awaitable
@@ -179,11 +180,14 @@ def run_handle_stop(
179180
_signal.signal(signal, setter)
180181

181182
while not to_run.done() and not loop.is_closed():
182-
try:
183-
result = loop.run_until_complete(to_run)
184-
except KeyboardInterrupt:
185-
print("Keyboard interrupt.")
186-
loop.call_soon_threadsafe(stop_sig.set)
183+
with _suppress(KeyboardInterrupt):
184+
if not loop.is_running():
185+
loop.run_until_complete(to_run)
186+
else:
187+
_time.sleep(0.1)
188+
189+
if to_run.done():
190+
result = to_run.result()
187191

188192
return result
189193

0 commit comments

Comments
 (0)