From e2ee81dafb3ccca867373d088b34a0caa72c3c0d Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 21 Mar 2019 17:29:24 +0100 Subject: [PATCH] crypto: Create a public non-throwing check for msoffcrypto --- oletools/crypto.py | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/oletools/crypto.py b/oletools/crypto.py index ffd16ec..1e3e737 100644 --- a/oletools/crypto.py +++ b/oletools/crypto.py @@ -209,6 +209,11 @@ def _check_msoffcrypto(): raise CryptoLibNotImported() +def check_msoffcrypto(): + """Return `True` iff :py:mod:`msoffcrypto` could be imported.""" + return msoffcrypto is not None + + def decrypt(filename, passwords=None, **temp_file_args): """ Try to decrypt an encrypted file -- libgit2 0.21.4