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:
parent
749e436c63
commit
c513744d89
@ -1075,7 +1075,7 @@ class DataTableMetaclass(type):
|
|||||||
# Iterate in reverse to preserve final order
|
# Iterate in reverse to preserve final order
|
||||||
for base in reversed(bases):
|
for base in reversed(bases):
|
||||||
if hasattr(base, 'base_columns'):
|
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)
|
dt_attrs['base_columns'] = collections.OrderedDict(columns)
|
||||||
|
|
||||||
# If the table is in a ResourceBrowser, the column number must meet
|
# If the table is in a ResourceBrowser, the column number must meet
|
||||||
|
Loading…
Reference in New Issue
Block a user