Skip to content

Commit 5cdf3e0

Browse files
author
Steve Canny
committed
tbl: base _RowCells on Parented
1 parent ca211ca commit 5cdf3e0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docx/table.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,15 @@ def cells(self):
230230
Sequence of |_Cell| instances corresponding to cells in this row.
231231
Supports ``len()``, iteration and indexed access.
232232
"""
233-
return _RowCells(self._tr)
233+
return _RowCells(self._tr, self)
234234

235235

236-
class _RowCells(object):
236+
class _RowCells(Parented):
237237
"""
238238
Sequence of |_Cell| instances corresponding to the cells in a table row.
239239
"""
240-
def __init__(self, tr):
241-
super(_RowCells, self).__init__()
240+
def __init__(self, tr, parent):
241+
super(_RowCells, self).__init__(parent)
242242
self._tr = tr
243243

244244
def __getitem__(self, idx):

tests/test_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def it_raises_on_indexed_access_out_of_range(self, cell_count_fixture):
316316

317317
@pytest.fixture
318318
def cell_count_fixture(self):
319-
cells = _RowCells(element('w:tr/(w:tc, w:tc)'))
319+
cells = _RowCells(element('w:tr/(w:tc, w:tc)'), None)
320320
cell_count = 2
321321
return cells, cell_count
322322

0 commit comments

Comments
 (0)