File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 11import typing as ty
22
33from docx import Document
4+ from docx .document import Document as DocumentObject
45
56from fileformats .core import FileSet , extra_implementation
67from fileformats .vendor .openxmlformats_officedocument .application import (
78 Wordprocessingml_Document as MswordX ,
89)
910
10- if ty .TYPE_CHECKING :
11- from docx .document import Document as DocumentObject
12-
1311
1412@extra_implementation (FileSet .load )
15- def load_docx (doc : MswordX , ** kwargs : ty .Any ) -> " DocumentObject" :
13+ def load_docx (doc : MswordX , ** kwargs : ty .Any ) -> DocumentObject :
1614 return Document (str (doc )) # type: ignore[no-any-return]
1715
1816
1917@extra_implementation (FileSet .save )
20- def save_docx (doc : MswordX , data : " DocumentObject" , ** kwargs : ty .Any ) -> None :
18+ def save_docx (doc : MswordX , data : DocumentObject , ** kwargs : ty .Any ) -> None :
2119 data .save (str (doc ))
You can’t perform that action at this time.
0 commit comments