google-gemini / generative-ai-python

The official Python library for the Google Gemini API
https://pypi.org/project/google-generativeai/
Apache License 2.0
1.63k stars 324 forks source link

Notebook magic test broken by python 3.12.5 release. #520

Closed MarkDaoust closed 3 months ago

MarkDaoust commented 3 months ago

Description of the bug:

https://docs.python.org/3/whatsnew/changelog.html

gh-121018: Fixed issues where argparse.ArgumentParser.parse_args() did not honor exit_on_error=False. Based on patch by Ben Hsing.

We set exit_on_error=False, but then patch exit to throw a custom exception, catch it, and raise SystemExit (?).

One test is failing, blocking PRs.

Actual vs expected behavior:

Test should pass.

Any other information you'd like to share?

No response