OLD | NEW |
(Empty) | |
| 1 """ |
| 2 For the ``future`` package. |
| 3 |
| 4 Turns any xrange calls into range calls and adds this import line: |
| 5 |
| 6 from builtins import range |
| 7 |
| 8 at the top. |
| 9 """ |
| 10 |
| 11 from lib2to3.fixes.fix_xrange import FixXrange |
| 12 |
| 13 from libfuturize.fixer_util import touch_import_top |
| 14 |
| 15 |
| 16 class FixXrangeWithImport(FixXrange): |
| 17 def transform(self, node, results): |
| 18 result = super(FixXrangeWithImport, self).transform(node, results) |
| 19 touch_import_top('builtins', 'range', node) |
| 20 return result |
OLD | NEW |