Skip to content

Commit 0e9f8ac

Browse files
author
Luke Zhang
committed
fix: suppress ruff PLC0415 for conditional gevent import
The generate_instrumentation_bootstrap.py script was failing with a ruff linting error (PLC0415: import should be at top-level) when checking the auto_instrumentation module. Add noqa comment to suppress this error for the gevent monkey patch import, which is intentionally inside a try-except block for conditional loading. This allows the bootstrap generation script to complete successfully.
1 parent f3d0394 commit 0e9f8ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation

opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def initialize(*, swallow_exceptions: bool = True) -> None:
149149
else:
150150
try:
151151
# pylint: disable=import-outside-toplevel
152-
from gevent import monkey
152+
from gevent import monkey # noqa: PLC0415
153153

154154
getattr(monkey, gevent_patch)()
155155
except ImportError:

0 commit comments

Comments
 (0)