Open
Description
Description
double return get printed
How to Reproduce
def main():
if input() == 0:
print("0")
return
if input() == 1:
print("1")
else:
printf("other")
I used add-test.py with python3.8 with the latest commit on the respective branch
Output Given
# uncompyle6 version 3.9.1.dev0
# Python bytecode version base 3.8.0 (3413)
# Decompiled from: Python 3.8.10 (default, Mar 13 2023, 10:26:41)
# [GCC 9.4.0]
# Embedded file name: 00_double_return.py
# Compiled at: 2023-05-31 12:07:25
# Size of source mod 2**32: 118 bytes
def main():
if input() == 0:
print('0')
return return None
elif input() == 1:
print('1')
else:
printf('other')
# okay decompiling bytecode_3.8/00_double_return.pyc
Expected behavior
def main():
if input() == 0:
print('0')
+ return
- return return None
elif input() == 1:
print('1')
else:
printf('other')
Environment
- Uncompyle6 version: output from
uncompyle6 --version
uncompyle6 3.9.1.dev0 - Python version for the version of Python the byte-compiled the file:
python -c "import sys; print(sys.version)"
wherepython
is the correct CPython or PyPy binary.
3.8.10 (default, Mar 13 2023, 10:26:41)
[GCC 9.4.0] - OS and Version: Linux codespaces-6db051 5.15.0-1038-azure Revert "Cache pip installation in travis" #45-Ubuntu SMP Mon Apr 24 15:40:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Workarounds
Remove the second run by hand
Priority
I found it while trying to reduce another bug
Additional Context
N/A