Skip to content

fix patch_name IndexError when @patch_to uses cls= kwarg#1612

Open
ruchi-mish90 wants to merge 1 commit into
AnswerDotAI:mainfrom
ruchi-mish90:fix/patch-to-cls-kwarg
Open

fix patch_name IndexError when @patch_to uses cls= kwarg#1612
ruchi-mish90 wants to merge 1 commit into
AnswerDotAI:mainfrom
ruchi-mish90:fix/patch-to-cls-kwarg

Conversation

@ruchi-mish90

Copy link
Copy Markdown

patch_name assumes @patch_to always gets its class positionally, so
d.args[0] crashes when someone writes @patch_to(cls=MyClass) instead.

Fall back to d.keywords when d.args is empty. Added a test for the
keyword form alongside the existing positional one.

Closes #1596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: nbdev Parser IndexError on @patch_to with Keyword Arguments

1 participant