From 6b4e343aadefb83dfca04e81d5b64e126210b25a Mon Sep 17 00:00:00 2001
From: jvoisin <julien.voisin@dustri.org>
Date: Mon, 4 Feb 2019 00:10:18 +0100
Subject: [PATCH] Bump coverage

---
 libmat2/office.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libmat2/office.py b/libmat2/office.py
index ee6cf91..db4b3e3 100644
--- a/libmat2/office.py
+++ b/libmat2/office.py
@@ -300,18 +300,13 @@ class MSOfficeParser(ArchiveBasedAbstractParser):
         Yes, I know that parsing xml with regexp ain't pretty,
         be my guest and fix it if you want.
         """
-        if not file_path.startswith('docProps/'):
-            return {}
-        elif not file_path.endswith('.xml'):
+        if not file_path.startswith('docProps/') and not file_path.endswith('.xml'):
             return {}
 
         with open(full_path, encoding='utf-8') as f:
             try:
                 results = re.findall(r"<(.+)>(.+)</\1>", f.read(), re.I|re.M)
-                metadata = {}
-                for (key, value) in results:
-                    metadata[key] = value
-                return metadata
+                return {k:v for (k, v) in results}
             except (TypeError, UnicodeDecodeError):
                 # We didn't manage to parse the xml file
                 return {file_path: 'harmful content', }
-- 
GitLab