diff options
| author | xmo-odoo <xmo@odoo.com> | 2017-04-25 13:04:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-25 13:04:54 +0200 |
| commit | 3cbca4b7348b60eb6cfe3f423983d53dada67862 (patch) | |
| tree | 0ee9739f66c5616219e50f9e21dc4d416f09b454 /addons/l10n_lu/scripts | |
| parent | 4441237b0a80cc8eca04a35ad825bce876a2d7b6 (diff) | |
[FIX] iterator definition & stepping
* in P3, the iterator stepping method has become a dunder method (next
-> __next__), the protocol has not changed, add a __next__ alias to
the iterator-next definition (nota: ir.config also has a next method
but it's not part of an iterator, so don't alias it and don't
convert calls to it)
* since ~2.6, a builtin (next()) has been added to step an iterator &
allow for a default (in case of iterator end), convert all manual
stepping to the builtin
Fixers:
libfuturize.fixes.fix_next_call
#8530
Diffstat (limited to 'addons/l10n_lu/scripts')
| -rw-r--r-- | addons/l10n_lu/scripts/tax2csv.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/l10n_lu/scripts/tax2csv.py b/addons/l10n_lu/scripts/tax2csv.py index c6a5bed6e44..710ebea9d88 100644 --- a/addons/l10n_lu/scripts/tax2csv.py +++ b/addons/l10n_lu/scripts/tax2csv.py @@ -59,7 +59,7 @@ class LuxTaxGenerator: writer = csv.writer(open('account.tax.code.template-%s.csv' % self.suffix, 'wb')) tax_codes_iterator = self.iter_tax_codes() - keys = tax_codes_iterator.next() + keys = next(tax_codes_iterator) writer.writerow(keys) # write structure tax codes @@ -87,7 +87,7 @@ class LuxTaxGenerator: new_tax_codes[tax_code_id] = (new_name, new_parent_code) taxes_iterator = self.iter_taxes() - keys = taxes_iterator.next() + next(taxes_iterator) for row in taxes_iterator: if not _is_true(row['active']): continue @@ -157,7 +157,7 @@ class LuxTaxGenerator: writer = csv.writer(open('account.tax.template-%s.csv' % self.suffix, 'wb')) taxes_iterator = self.iter_taxes() - keys = taxes_iterator.next() + keys = next(taxes_iterator) writer.writerow(keys[3:] + ['sequence']) seq = 100 for row in sorted(taxes_iterator, key=lambda r: r['description']): @@ -175,7 +175,7 @@ class LuxTaxGenerator: 'position.tax.template-%s.csv' % self.suffix, 'wb')) fiscal_pos_map_iterator = self.iter_fiscal_pos_map() - keys = fiscal_pos_map_iterator.next() + keys = next(fiscal_pos_map_iterator) writer.writerow(keys) for row in fiscal_pos_map_iterator: writer.writerow(map(_e, row.values())) |
