Message368355
When running "2to3 -f raise" on the following code, which uses an old Python 2.4 raise of a string:
def f():
raise ("message %s %s" % (1, 2))
try:
f()
finally:
pass
I obtain the following quite surprising result. I would have expected to get either an error or leave the original file unchanged, because "raise (s)" is syntactically valid although incorrect.
$ 2to3 -f raise w.py
RefactoringTool: Refactored w.py
--- w.py (original)
+++ w.py (refactored)
@@ -1,5 +1,5 @@
def f():
- raise ("message %s %s" % (1, 2))
+ raise "message %s %s"
try:
f() |
|
Date |
User |
Action |
Args |
2020-05-07 16:37:14 | Rémy Oudompheng | set | recipients:
+ Rémy Oudompheng |
2020-05-07 16:37:14 | Rémy Oudompheng | set | messageid: <1588869434.41.0.260360648069.issue40547@roundup.psfhosted.org> |
2020-05-07 16:37:14 | Rémy Oudompheng | link | issue40547 messages |
2020-05-07 16:37:14 | Rémy Oudompheng | create | |
|