Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f4bff18

Browse filesBrowse files
committed
Stop calling sys.exit() in a nested asyncio loop
1 parent 40ce970 commit f4bff18
Copy full SHA for f4bff18

File tree

Expand file treeCollapse file tree

2 files changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-0
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Changelog
1818
- fixed `EventManager` not waiting for platform events websocket connection during initialization
1919
- fixed local `RequestQueueClient` not respecting the `forefront` argument
2020
- fixed local `RequestQueueClient` not counting the `handledRequestCount` property
21+
- stopped calling `sys.exit()` in a nested asyncio loop
2122

2223
### Internal changes
2324

‎src/apify/actor.py

Copy file name to clipboardExpand all lines: src/apify/actor.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ async def _exit_internal(
351351
self.log.debug(f'Not calling sys.exit({exit_code}) because actor is running in IPython')
352352
elif os.getenv('PYTEST_CURRENT_TEST', False):
353353
self.log.debug(f'Not calling sys.exit({exit_code}) because actor is running in an unit test')
354+
elif hasattr(asyncio, '_nest_patched'):
355+
self.log.debug(f'Not calling sys.exit({exit_code}) because actor is running in a nested event loop')
354356
else:
355357
sys.exit(exit_code)
356358

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.