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 /odoo/tools/convert.py | |
| 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 'odoo/tools/convert.py')
| -rw-r--r-- | odoo/tools/convert.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index c7faab244d3..3410b929bc6 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -850,7 +850,7 @@ def convert_csv_import(cr, module, fname, csvcontent, idref=None, mode='init', input = cStringIO.StringIO(csvcontent) #FIXME reader = csv.reader(input, quotechar='"', delimiter=',') - fields = reader.next() + fields = next(reader) if not (mode == 'init' or 'id' in fields): _logger.error("Import specification does not contain 'id' and we are in init mode, Cannot continue.") |
