aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx/__init__.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2018-01-23 21:43:30 +0000
committerMichael Williamson <mike@zwobble.org>2018-01-23 21:43:30 +0000
commit93e07b02624f668aa9300c048cde05bb416dda35 (patch)
treeea83907583ae87fde53955f9e61065b5d9fd3231 /mammoth/docx/__init__.py
parent804dc4c1666c7f0c24528acf3cf3083a46492e4d (diff)
Raise error when main document part does not exist
Diffstat (limited to 'mammoth/docx/__init__.py')
-rw-r--r--mammoth/docx/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py
index 8ecf8c9..b155cff 100644
--- a/mammoth/docx/__init__.py
+++ b/mammoth/docx/__init__.py
@@ -77,7 +77,7 @@ def _find_document_filename(zip_file, relationships):
] + ["word/document.xml"]
valid_targets = list(filter(lambda target: zip_file.exists(target), targets))
if len(valid_targets) == 0:
- return None
+ raise IOError("Could not find main document part. Are you sure this is a valid .docx file?")
else:
return valid_targets[0]