Daniel Stutzbach <dan...@stutzbachenterprises.com> added the comment:
I don't think I'm familiar enough with 2to3's pattern-matching syntax to write a good patch. Here's a rough outline for how a patch would work. There are two cases: 1) When there is already a "from __future__ import". Currently, this line is stripped by fix_future. fix_future could be changed to remove the other futures, but add/leave "print_statement". This case is probably pretty straightforward. 2) When there is no "from __future__ import". A pattern would need to detect the absence of the __future__ line and insert one in the right place (after initial comments but before anything else). ---------- stage: -> needs patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7141> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com