Skip to content

Commit

Permalink
Merge pull request #1236 from Textualize/bump050
Browse files Browse the repository at this point in the history
bumped version
  • Loading branch information
willmcgugan committed Nov 20, 2022
2 parents 3bc8f17 + e7743d3 commit f5db482
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.5.0] - Unreleased
## [0.5.0] - 2022-11-20

### Added

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.4.0"
version = "0.5.0"
homepage = "https://github.com/Textualize/textual"
description = "Modern Text User Interface framework"
authors = ["Will McGugan <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2011,15 +2011,15 @@ async def _prune_node(self, root: Widget) -> None:
for children in reversed(node_children):
# Closing children can be done asynchronously.
close_messages = [
child._close_messages() for child in children if child._running
child._close_messages(wait=True) for child in children if child._running
]
# TODO: What if a message pump refuses to exit?
if close_messages:
await asyncio.gather(*close_messages)
for child in children:
self._unregister(child)

await root._close_messages()
await root._close_messages(wait=False)
self._unregister(root)

async def action_check_bindings(self, key: str) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/textual/message_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _close_messages_no_wait(self) -> None:
async def _on_close_messages(self, message: messages.CloseMessages) -> None:
await self._close_messages()

async def _close_messages(self) -> None:
async def _close_messages(self, wait: bool = True) -> None:
"""Close message queue, and optionally wait for queue to finish processing."""
if self._closed or self._closing:
return
Expand All @@ -296,7 +296,7 @@ async def _close_messages(self) -> None:
await self._message_queue.put(events.Unmount(sender=self))
Reactive._reset_object(self)
await self._message_queue.put(None)
if self._task is not None and asyncio.current_task() != self._task:
if wait and self._task is not None and asyncio.current_task() != self._task:
# Ensure everything is closed before returning
await self._task

Expand Down

0 comments on commit f5db482

Please sign in to comment.