aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/docx/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py
index c4c6877..326c85b 100644
--- a/mammoth/docx/__init__.py
+++ b/mammoth/docx/__init__.py
@@ -70,10 +70,11 @@ def _read_document(zip_file, body_readers, notes, comments):
def _find_document_filename(zip_file, relationships):
- targets = ["word/document.xml"] + [
+ office_document_type = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
+ targets = [
target.lstrip("/")
- for target in relationships.find_targets_by_type("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument")
- ]
+ for target in relationships.find_targets_by_type(office_document_type)
+ ] + ["word/document.xml"]
valid_targets = list(filter(lambda target: zip_file.exists(target), targets))
if len(valid_targets) == 0:
return None