-
Notifications
You must be signed in to change notification settings - Fork 88
Adds Python3.8 support #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
(overrides previous fix, as merging them would be too complex and unneeded)
I was not able to get it to happen for pretty huge functions (much much larger than the ones in the test), though, so there's a good chance it's unreachable.
(This was originally in the second PR, but since you want to take this one first, I think it's a good commit to add here, since it's relevant to this change and would make diffing against future PRs easier)
Added 4 tests, 3 currently disabled (pre-existing issues, especially on pypy).
(The new test helps test functionality that needs special attention at least on py38)
Details:
|
Can you rebase this pull request? (Or alternatively merging |
FYI the "Various minor crash/etc fixes" one doesn't fail checks, probably best to skip this PR and merge that. (No point in trying to analyze an already fixed bug) |
except AttributeError: | ||
pass | ||
return code.replace(co_code=codestring) # new in 3.8+ | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please no bare expect
s, this should be expect AttributeError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I'll fix
|
||
return size | ||
|
||
def _get_instructions_size(ops): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you did a mistake during merge. This function, and the one above are now defined twice, see below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, merge failure. I see you added flake8 which catches this, I'll fix it (in the other PR).
@@ -63,6 +63,18 @@ def func(): | |||
assert func() == 0 | |||
|
|||
|
|||
def test_jump_out_of_loop_and_survive(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might (likely) miss something here, but how is this new test related to adding support for Python 3.8?
@@ -34,6 +34,8 @@ def __init__(self): | |||
self.have_argument = dis.HAVE_ARGUMENT | |||
self.jump_unit = 1 | |||
|
|||
self.has_loop_blocks = 'SETUP_LOOP' in dis.opmap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should rather check for 'SETUP_LOOP' in dis.opmap
in place than aliasing the result of this check here? It doesn't seem to save much writing, neither does it seem to improve performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's cleaner, and it's far from a sole occurrence - see the later PRs which add more such checks, some (I think) used more than once.
Yes, let's focus on #22 instead of this PR. It's provided here so you can review it as a "step" separate from #22, but it's evidently missing some fixes included in #22 and there's no reason to start digging which fix is needed. (And I don't see a reason to remove the py38 changes from the #22 PR before merging it, you've already reviewed them here, it'd just be extra busywork) It's already merged against master, and I'll fix it up per your comments and flake8 shortly |
Based on PR #21, adds python3.8 support (previously part of the 'fix2' PR)