Fix MAKE_FUNCTION default args for py 3.4 #538
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.
Some changes for the handling of MAKE_FUNCTION operand & arguments in py3.0-3.5 that I discovered while updating MAKE_FUNCTION to support the changed operand for py3.6+ (planning to raise that as another PR).
MAKE_FUNCTION Python 3.0 Docs
MAKE_FUNCTION Python 3.4 Docs
Summary
Tests
The
test_functions_py3
tests were passing for 3.0 & 3.4, but the .pyc's & tokenized files were missing a number of additional cases that were present in the input .pyThe changes to the .pyc's & tokenized output are to include these additional cases. I used the
token_dump
andpymultic
scripts for this, with a slight modification to use-alpine
containers inpymultic
.Wrong Order of Arg Defaults
With the current
master
,pycdc
produced this output for the last test case on py3.4.However, this is the input
With the issue seeming to be the changed order of Position & Kwarg defaults on the stack between 3.3 & newer.
Incorrect Popping of Kwarg Defaults
I also added an additional test case with multiple Kwargs:
Again with the current
master
this fails for py3.0and for py3.4
Which seems to be due to only 1 item being popped from the stack per Kwarg, when there are actually 2 (value followed by key).
Related Issues
#91 ?