This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hawking
Recipients collinwinter, hawking
Date 2008-08-16.07:03:05
SpamBayes Score 0.00084505684
Marked as misclassified No
Message-id <1218870188.26.0.589326010093.issue3563@psf.upfronthosting.co.za>
In-reply-to
Content
fix_idioms.py generates bad code for conversions in try/except blocks.
Example:
s=(1, 2, 3)
try:
    t = list(s)
    t.sort()
except TypeError:
    pass

fix_idioms.py generates this diff:
--- test.py (original)
+++ test.py (refactored)
@@ -7,8 +7,7 @@
 
 s=(1, 2, 3)
 try:
-    t = list(s)
-    t.sort()
-except TypeError:
+    t = sorted(s)
+    except TypeError:
     pass
 
except TypeError is indented wrongly.
History
Date User Action Args
2008-08-16 07:03:08hawkingsetrecipients: + hawking, collinwinter
2008-08-16 07:03:08hawkingsetmessageid: <1218870188.26.0.589326010093.issue3563@psf.upfronthosting.co.za>
2008-08-16 07:03:06hawkinglinkissue3563 messages
2008-08-16 07:03:06hawkingcreate