Skip to content

🐛 Bug Report: SyntaxWarning: 'return' in a 'finally' block #3969

@itsaphel

Description

@itsaphel

Which component is this bug for?

OpenAI Instrumentation

📜 Description

On Python 3.14:

venv/lib/python3.14/site-packages/opentelemetry/instrumentation/openai/v1/responses_wrappers.py:936: SyntaxWarning: 'return' in a 'finally' block
  return self.__wrapped__.close()
.venv/lib/python3.14/site-packages/opentelemetry/instrumentation/openai/v1/responses_wrappers.py:943: SyntaxWarning: 'return' in a 'finally' block
  return await self.__wrapped__.aclose()

👟 Reproduction steps

  1. Use the library

👍 Expected behavior

No SyntaxWarning

👎 Actual Behavior with Screenshots

🤖 Python Version

3.14

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions