fix: SentinelNodeFinder uses now mangled_name#95
Conversation
e7fbef0 to
6c3459c
Compare
executing/_types.py
Outdated
executing/executing.py
Outdated
| if sys.version_info[0] == 3 or instruction.argval: | ||
| extra_filter =lambda e:mangled_name(e) == instruction.argval |
There was a problem hiding this comment.
| if sys.version_info[0] == 3 or instruction.argval: | |
| extra_filter =lambda e:mangled_name(e) == instruction.argval | |
| extra_filter =lambda e:mangled_name(e) == instruction.argval |
python 3 only now
executing/executing.py
Outdated
| print(instruction) | ||
|
|
||
| print(exprs) | ||
|
|
There was a problem hiding this comment.
| print(instruction) | |
| print(exprs) |
tests/test_pytest.py
Outdated
| import dis | ||
|
|
||
| def test_mangled_name(): | ||
| @pytest.mark.skipif(sys.version_info < (3,), reason="argval of some Instructions is None") |
There was a problem hiding this comment.
| @pytest.mark.skipif(sys.version_info < (3,), reason="argval of some Instructions is None") |
tests/test_pytest.py
Outdated
| if sys.version_info < (3,): | ||
| def indent(s,prefix): | ||
| return prefix + s.replace("\n","\n"+prefix) | ||
| else: | ||
| from textwrap import indent |
There was a problem hiding this comment.
| if sys.version_info < (3,): | |
| def indent(s,prefix): | |
| return prefix + s.replace("\n","\n"+prefix) | |
| else: | |
| from textwrap import indent | |
| from textwrap import indent |
tests/test_pytest.py
Outdated
| from executing._utils import mangled_name | ||
| import dis |
tests/test_pytest.py
Outdated
| ast.ExceptHandler, | ||
| ), | ||
| ) | ||
| if sys.version_info>=(3,): |
tests/test_pytest.py
Outdated
| # IMPORT_FROM(_Test__submodule11c) | ||
| # STORE_NAME(_Test__subc11) | ||
|
|
||
| if instruction.opname=="LOAD_ATTR" and before is not None and before.opname == "IMPORT_NAME": |
There was a problem hiding this comment.
| if instruction.opname=="LOAD_ATTR" and before is not None and before.opname == "IMPORT_NAME": | |
| if instruction.opname == "LOAD_ATTR" and before is not None and before.opname == "IMPORT_NAME": |
we really need proper tooling in this repo like ruff
There was a problem hiding this comment.
yes, I was thinking the same already last year. I will create an issue with some step by step plan.
|
Thank you for taking the time to review this, and please excuse the silly mistakes. |
executing/executing.py
Outdated
| typ = ast.Name | ||
| ctx = ast.Load | ||
| extra_filter = lambda e: e.id == instruction.argval | ||
| if instruction.argval: |
There was a problem hiding this comment.
The original was if sys.version_info[0] == 3 or instruction.argval:, with an or, so is this check needed?
There was a problem hiding this comment.
it is not needed 4 lines above and it is most likely not needed here.
|
any idea what's going on with github? |
|
Microsoft has taken over ... I have no idea. |
|
I have restarted them with debug output but they are just waiting ... |
9690215 to
65b15b0
Compare
65b15b0 to
b44d92d
Compare
|
github could not schedule the jobs because ubuntu 20.04 was not available any more. |
tests/test_pytest.py
Outdated
| # STORE_NAME(_Test__subc11) | ||
|
|
||
| if instruction.opname == "LOAD_ATTR" and before is not None and before.opname == "IMPORT_NAME": | ||
| continue |
| # covered by the verifier and much more complex in python 3.11 | ||
| if isinstance(node, ast.Name) and not py11: | ||
| assert inst.argval == node.id, (inst, ast.dump(node)) | ||
| if isinstance(node, ast.Name) and inst.opname != "CALL_INTRINSIC_1" and inst.argval not in ("__classdict__","__classdictcell__","__static_attributes__"): |
There was a problem hiding this comment.
Deleting it caused no problem and I can't remember why this was needed. Maybe it is just not needed any more.
There was a problem hiding this comment.
looks like this reply was meant to be on the other comment?
There was a problem hiding this comment.
Yes, sorry. I wrote it on my phone.
|
Thanks! |
closes #99