-
Notifications
You must be signed in to change notification settings - Fork 13
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
add fix for import tracker compatibility with py3.11 #75
Conversation
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.
Small code-golf improvement request. Also, it looks like you need to rebase with signoff:
remote=<remote name for maineline repo>
git fetch $remote
git rebase $remote/main --signoff
git push -f
import_tracker/import_tracker.py
Outdated
@@ -322,9 +322,10 @@ def _get_value_col(dis_line: str) -> str: | |||
def _get_op_number(dis_line: str) -> Optional[int]: | |||
"""Get the opcode number out of the line of `dis` output""" | |||
line_parts = dis_line.split() | |||
if not line_parts: | |||
temp = [i for i, val in enumerate(line_parts) if val.isupper()] |
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.
Slight tightness suggestion (can't apply as a real suggestion
over deleted lines I guess?)
if not (valid_line_part_idxs := [i for i, val in enumerate(line_parts) if val.isupper()]):
return None
opcode_idx = min(valid_line_parts)
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.
Updated. Thanks.
Signed-off-by: Xuancheng Fan <[email protected]>
Signed-off-by: Xuancheng Fan <[email protected]>
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.
Let's try this
3.7 compatible without walrus operator Signed-off-by: Gabe Goodhart <[email protected]>
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.
Thanks for the fix!
#74