Skip to content

Commit 4357499

Browse files
committed
Change raise StopIteration to return
Before this change: ``` (pyevmasm) dc@ubuntu:~/projects/pyevmasm/tests$ PYTHONPATH=../pyevmasm python test_EVMAssembler.py test_EVMAssembler.py:21: DeprecationWarning: generator 'disassemble_all' raised StopIteration self.assertTrue(all(a == b for a, b in zip(instructions1, instructions2))) /home/dc/projects/pyevmasm/pyevmasm/evmasm.py:1007: DeprecationWarning: generator 'disassemble_all' raised StopIteration return '\n'.join(map(str, disassemble_all(bytecode, pc=pc, fork=fork))) ...... ---------------------------------------------------------------------- Ran 6 tests in 0.003s OK ``` After this change: ``` (pyevmasm) dc@ubuntu:~/projects/pyevmasm/tests$ PYTHONPATH=../pyevmasm python test_EVMAssembler.py ...... ---------------------------------------------------------------------- Ran 6 tests in 0.002s OK ```
1 parent 0a9287c commit 4357499

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyevmasm/evmasm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def disassemble_all(bytecode, pc=0):
681681
while True:
682682
instr = disassemble_one(bytecode, pc=pc)
683683
if not instr:
684-
raise StopIteration
684+
return
685685
pc += instr.size
686686
yield instr
687687

0 commit comments

Comments
 (0)