bytecode 0.16.1__tar.gz → 0.16.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bytecode-0.16.1 → bytecode-0.16.2}/.github/workflows/release.yml +2 -2
- {bytecode-0.16.1/src/bytecode.egg-info → bytecode-0.16.2}/PKG-INFO +3 -2
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/changelog.rst +8 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/cfg.py +8 -2
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/instr.py +7 -7
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/version.py +2 -2
- {bytecode-0.16.1 → bytecode-0.16.2/src/bytecode.egg-info}/PKG-INFO +3 -2
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_cfg.py +14 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.coveragerc +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.github/FUNDING.yml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.github/dependabot.yml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.github/workflows/cis.yml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.github/workflows/docs.yml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.github/workflows/frameworks.yml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.gitignore +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.pre-commit-config.yaml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/.readthedocs.yaml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/COPYING +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/MANIFEST.in +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/README.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/TODO.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/codecov.yml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/Makefile +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/api.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/byteplay_codetransformer.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/cfg.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/conf.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/index.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/make.bat +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/requirements.txt +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/todo.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/doc/usage.rst +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/pyproject.toml +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/scripts/frameworks/boto3/run.sh +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/scripts/frameworks/boto3/setup.sh +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/setup.cfg +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/__init__.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/bytecode.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/concrete.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/flags.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/py.typed +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode/utils.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode.egg-info/SOURCES.txt +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode.egg-info/dependency_links.txt +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode.egg-info/requires.txt +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/src/bytecode.egg-info/top_level.txt +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/__init__.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/cell_free_vars_cases.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/exception_handling_cases.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/frameworks/function.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/frameworks/module.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/frameworks/sitecustomize.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/long_lines_example.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_bytecode.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_code.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_concrete.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_flags.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_instr.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/test_misc.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tests/util_annotation.py +0 -0
- {bytecode-0.16.1 → bytecode-0.16.2}/tox.ini +0 -0
|
@@ -74,7 +74,7 @@ jobs:
|
|
|
74
74
|
runs-on: ubuntu-latest
|
|
75
75
|
steps:
|
|
76
76
|
- name: Download all the dists
|
|
77
|
-
uses: actions/download-artifact@v4.1
|
|
77
|
+
uses: actions/download-artifact@v4.2.1
|
|
78
78
|
with:
|
|
79
79
|
pattern: cibw-*
|
|
80
80
|
path: dist
|
|
@@ -101,7 +101,7 @@ jobs:
|
|
|
101
101
|
|
|
102
102
|
steps:
|
|
103
103
|
- name: Download all the dists
|
|
104
|
-
uses: actions/download-artifact@v4.1
|
|
104
|
+
uses: actions/download-artifact@v4.2.1
|
|
105
105
|
with:
|
|
106
106
|
pattern: cibw-*
|
|
107
107
|
path: dist
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: bytecode
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.2
|
|
4
4
|
Summary: Python module to generate and modify bytecode
|
|
5
5
|
Author-email: Victor Stinner <victor.stinner@gmail.com>
|
|
6
6
|
Maintainer-email: "Matthieu C. Dartiailh" <m.dartiailh@gmail.com>
|
|
@@ -47,6 +47,7 @@ Requires-Python: >=3.8
|
|
|
47
47
|
Description-Content-Type: text/x-rst
|
|
48
48
|
License-File: COPYING
|
|
49
49
|
Requires-Dist: typing_extensions; python_version < "3.10"
|
|
50
|
+
Dynamic: license-file
|
|
50
51
|
|
|
51
52
|
********
|
|
52
53
|
bytecode
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
ChangeLog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
2025-04-14: Version 0.16.2
|
|
5
|
+
--------------------------
|
|
6
|
+
|
|
7
|
+
Bugfixes:
|
|
8
|
+
|
|
9
|
+
- fix ControlFlowGraph dead block detection by accounting for fall-through
|
|
10
|
+
edges. PR #161
|
|
11
|
+
|
|
4
12
|
2025-01-21: Version 0.16.1
|
|
5
13
|
--------------------------
|
|
6
14
|
|
|
@@ -731,12 +731,18 @@ class ControlFlowGraph(_bytecode.BaseBytecode):
|
|
|
731
731
|
if id(block) in seen_block_ids:
|
|
732
732
|
continue
|
|
733
733
|
seen_block_ids.add(id(block))
|
|
734
|
+
fall_through = True
|
|
734
735
|
for i in block:
|
|
735
|
-
if isinstance(i, Instr)
|
|
736
|
-
|
|
736
|
+
if isinstance(i, Instr):
|
|
737
|
+
if isinstance(i.arg, BasicBlock):
|
|
738
|
+
stack.append(i.arg)
|
|
739
|
+
if i.is_final():
|
|
740
|
+
fall_through = False
|
|
737
741
|
elif isinstance(i, TryBegin):
|
|
738
742
|
assert isinstance(i.target, BasicBlock)
|
|
739
743
|
stack.append(i.target)
|
|
744
|
+
if fall_through and block.next_block:
|
|
745
|
+
stack.append(block.next_block)
|
|
740
746
|
|
|
741
747
|
return [b for b in self if id(b) not in seen_block_ids]
|
|
742
748
|
|
|
@@ -336,15 +336,15 @@ STATIC_STACK_EFFECTS: Dict[str, Tuple[int, int]] = {
|
|
|
336
336
|
"CHECK_EXC_MATCH": (-2, 2), # (TOS1, TOS) -> (TOS1, bool)
|
|
337
337
|
"CHECK_EG_MATCH": (-2, 2), # (TOS, TOS1) -> non-matched, matched or TOS1, None)
|
|
338
338
|
"PREP_RERAISE_STAR": (-2, 1), # (TOS1, TOS) -> new exception group)
|
|
339
|
-
**
|
|
340
|
-
**
|
|
341
|
-
|
|
342
|
-
for k in (
|
|
339
|
+
**dict.fromkeys((o for o in _opcode.opmap if o.startswith("UNARY_")), (-1, 1)),
|
|
340
|
+
**dict.fromkeys(
|
|
341
|
+
(
|
|
343
342
|
o
|
|
344
343
|
for o in _opcode.opmap
|
|
345
|
-
if
|
|
346
|
-
)
|
|
347
|
-
|
|
344
|
+
if o.startswith("BINARY_") or o.startswith("INPLACE_")
|
|
345
|
+
),
|
|
346
|
+
(-2, 1),
|
|
347
|
+
),
|
|
348
348
|
# Python 3.12 changes not covered by dis.stack_effect
|
|
349
349
|
"BINARY_SLICE": (-3, 1),
|
|
350
350
|
# "STORE_SLICE" handled by dis.stack_effect
|
|
@@ -5,7 +5,7 @@ from collections import namedtuple
|
|
|
5
5
|
#: A namedtuple of the version info for the current release.
|
|
6
6
|
_version_info = namedtuple("_version_info", "major minor micro status")
|
|
7
7
|
|
|
8
|
-
parts = "0.16.
|
|
8
|
+
parts = "0.16.2".split(".", 3)
|
|
9
9
|
version_info = _version_info(
|
|
10
10
|
int(parts[0]),
|
|
11
11
|
int(parts[1]),
|
|
@@ -16,4 +16,4 @@ version_info = _version_info(
|
|
|
16
16
|
# Remove everything but the 'version_info' from this module.
|
|
17
17
|
del namedtuple, _version_info, parts
|
|
18
18
|
|
|
19
|
-
__version__ = "0.16.
|
|
19
|
+
__version__ = "0.16.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: bytecode
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.2
|
|
4
4
|
Summary: Python module to generate and modify bytecode
|
|
5
5
|
Author-email: Victor Stinner <victor.stinner@gmail.com>
|
|
6
6
|
Maintainer-email: "Matthieu C. Dartiailh" <m.dartiailh@gmail.com>
|
|
@@ -47,6 +47,7 @@ Requires-Python: >=3.8
|
|
|
47
47
|
Description-Content-Type: text/x-rst
|
|
48
48
|
License-File: COPYING
|
|
49
49
|
Requires-Dist: typing_extensions; python_version < "3.10"
|
|
50
|
+
Dynamic: license-file
|
|
50
51
|
|
|
51
52
|
********
|
|
52
53
|
bytecode
|
|
@@ -712,6 +712,20 @@ class BytecodeBlocksFunctionalTests(TestCase):
|
|
|
712
712
|
other_block = BasicBlock()
|
|
713
713
|
self.assertRaises(ValueError, blocks.get_block_index, other_block)
|
|
714
714
|
|
|
715
|
+
def test_get_dead_blocks(self):
|
|
716
|
+
def condition():
|
|
717
|
+
pass
|
|
718
|
+
|
|
719
|
+
def test():
|
|
720
|
+
if condition():
|
|
721
|
+
print("1")
|
|
722
|
+
else:
|
|
723
|
+
print("2")
|
|
724
|
+
|
|
725
|
+
bytecode = Bytecode.from_code(test.__code__)
|
|
726
|
+
cfg = ControlFlowGraph.from_bytecode(bytecode)
|
|
727
|
+
assert len(cfg.get_dead_blocks()) == 0
|
|
728
|
+
|
|
715
729
|
|
|
716
730
|
class CFGStacksizeComputationTests(TestCase):
|
|
717
731
|
def check_stack_size(self, func):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|