Skip to content
New issue

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

The FixRaise in fix_raise can't fix the py2 code into 2/3 compatible when exception followed by a traceback. #643

Open
bulbyang opened this issue Jul 25, 2024 · 0 comments

Comments

@bulbyang
Copy link

bulbyang commented Jul 25, 2024

The py2 code is here

import sys

traceback = sys.exc_info()[2]

raise ValueError, "wrong value", traceback

The code generated by futurize is here

import sys

traceback = sys.exc_info()[2]

raise ValueError("wrong value").with_traceback(traceback)

The second one is only legal on python3.
I think that it is reasonable to fix the exception with traceback by use the function future.utils.raise_()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant