Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bytecode_version is annotated as a str, but decompile in reality only accepts tuples.
bytecode_version
str
decompile
>>> from uncompyle6.main import decompile >>> def a():print("hello world") ... >>> decompile(a.__code__,"3.8") # uncompyle6 version 3.9.0a1 # Python bytecode version base 3...8 # Decompiled from: Python 3.9.12 (main, Mar 24 2022, 13:02:21) # [GCC 11.2.0] # Embedded file name: <stdin> Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/redacted/.local/lib/python3.9/site-packages/uncompyle6/main.py", line 143, in decompile deparsed = deparse_fn( File "/home/redacted/.local/lib/python3.9/site-packages/uncompyle6/semantics/pysource.py", line 1471, in code_deparse deparsed = walker( File "/home/redacted/.local/lib/python3.9/site-packages/uncompyle6/semantics/pysource.py", line 314, in __init__ customize_for_version(self, is_pypy, version) File "/home/redacted/.local/lib/python3.9/site-packages/uncompyle6/semantics/customize.py", line 112, in customize_for_version if version >= (3, 0): TypeError: '>=' not supported between instances of 'str' and 'tuple'
Either strings should be accepted, or the type annotation be changed to tuple[int].
tuple[int]
uncompyle6 3.9.0a1
(I installed the latest version from github)
3.9.12 (main, Mar 24 2022, 13:02:21) [GCC 11.2.0]
Pass tuple(map(int,version.split("."))) instead
tuple(map(int,version.split(".")))
The text was updated successfully, but these errors were encountered:
464801b
No branches or pull requests
Description
bytecode_version
is annotated as astr
, butdecompile
in reality only accepts tuples.How to Reproduce
Expected behavior
Either strings should be accepted, or the type annotation be changed to
tuple[int]
.Environment
(I installed the latest version from github)
Workarounds
Pass
tuple(map(int,version.split(".")))
insteadThe text was updated successfully, but these errors were encountered: