[PR #6765] refactor: replace bare except with BaseException in AsyncQueue #5274

Closed
opened 2026-02-20 17:51:28 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6765

State: closed
Merged: Yes


Description

Replaced a bare except: with except BaseException: in libs/langgraph/langgraph/_internal/_queue.py.

Motivation

Using a bare except: violates PEP 8 (E722). While functionally equivalent to except BaseException:, making it explicit improves code readability and satisfies static analysis tools.

This ensures that asyncio.CancelledError (which inherits from BaseException) is still caught and handled correctly by the cancellation logic in the wait() method, but without the ambiguity of a bare except.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6765 **State:** closed **Merged:** Yes --- ## Description Replaced a bare `except:` with `except BaseException:` in `libs/langgraph/langgraph/_internal/_queue.py`. ## Motivation Using a bare `except:` violates PEP 8 (E722). While functionally equivalent to `except BaseException:`, making it explicit improves code readability and satisfies static analysis tools. This ensures that `asyncio.CancelledError` (which inherits from `BaseException`) is still caught and handled correctly by the cancellation logic in the `wait()` method, but without the ambiguity of a bare except.
yindo added the pull-request label 2026-02-20 17:51:28 -05:00
yindo closed this issue 2026-02-20 17:51:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5274