Fix Python 3 issue in DataTableMetaclass constructor

Don't use "dict.items() + list": on Python 3, dict.items() now
returns a view, not a list. Use the "list[0:0] = iterable" syntax
instead which accepts an iterable, including dictionary views.

Closes-Bug: #1495874
Partial-Implements: blueprint porting-python3
Change-Id: I2334bc6dd19fecfe0b6e03a7722b6fc10ff873e0
This commit is contained in:
Victor Stinner 2015-09-15 11:24:08 +02:00
parent 749e436c63
commit c513744d89
1 changed files with 1 additions and 1 deletions

View File

@ -1075,7 +1075,7 @@ class DataTableMetaclass(type):
# Iterate in reverse to preserve final order
for base in reversed(bases):
if hasattr(base, 'base_columns'):
columns = base.base_columns.items() + columns
columns[0:0] = base.base_columns.items()
dt_attrs['base_columns'] = collections.OrderedDict(columns)
# If the table is in a ResourceBrowser, the column number must meet