Skip to content

Commit cf5437b

Browse files
authored
Merge pull request #623 from waketzheng/fix-subdoc
Fix NameError Subdoc is not defined
2 parents f96b0b6 + fab696c commit cf5437b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docxtpl/template.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
@author: Eric Lapouyade
66
"""
7+
from __future__ import annotations
78

89
from os import PathLike
910
from typing import TYPE_CHECKING, Any, Optional, IO, Union, Dict, Set
@@ -537,7 +538,7 @@ def fix_tables(self, xml):
537538
width = 0.0
538539
new_average = None
539540
for c in columns:
540-
if not c.get(ns + "w") is None:
541+
if c.get(ns + "w") is not None:
541542
width += float(c.get(ns + "w"))
542543
# try to keep proportion of table
543544
if width > 0:

0 commit comments

Comments
 (0)