From 7021308c9ec3175b2f3645692615ec118c679e12 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 23 Sep 2021 22:42:30 -0700 Subject: [PATCH] Add call to coinitialize. --- voussoirkit/winwhich.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/voussoirkit/winwhich.py b/voussoirkit/winwhich.py index ed4fcd1..77068e6 100644 --- a/voussoirkit/winwhich.py +++ b/voussoirkit/winwhich.py @@ -14,6 +14,9 @@ import os import shutil try: import winshell + # This fixes some "CoInitialize has not been called" errors which I found + # were occuring intermittently on some subprocess calls. + winshell.pythoncom.CoInitialize() except ImportError: winshell = None