Repository navigation
Fix unregister argument validation under optimized Python - #771
Closed
himanshu748 wants to merge 1 commit into
Closed
himanshu748 wants to merge 1 commit into
himanshu748 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #762.
Replace the two argument-validation assertions in
PluginManager.unregister()with explicit exceptions:TypeErrorwhen neither a plugin nor a name is supplied.ValueErrorwhen an unregistered plugin object is supplied without a name.The checks now remain active under optimized Python. Existing behavior for successful unregisters, unknown or blocked names, and conflicting name/object arguments is preserved. The docstring and changelog document the exception-type compatibility change.
Validation on CPython 3.12.14:
-Oand-OO: 12 passed in each mode.tox run -e docspassed with Sphinx warnings treated as errors.The tracked lockfile pins pytest 3.2.5, which cannot start on Python 3.12 because it imports
imp. Validation used temporary upgraded local dependencies (pytest 9.1.1), then restored the lockfile and reran tests and pre-commit withUV_NO_SYNC=1. No dependency or lockfile changes are included.AI-assisted contribution: implementation, tests, and validation were performed with Codex and independently reviewed by another agent. No manual human review is claimed.