From 7e5b09bee83be403b382ff676545d31acf9b3ec3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu>
Date: Sun, 2 Jul 2017 20:38:56 +0200
Subject: [PATCH] Avoid patching asyncio on Windows

---
 flamenco_worker/patch_asyncio.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/flamenco_worker/patch_asyncio.py b/flamenco_worker/patch_asyncio.py
index 3299a351..1b98d34d 100644
--- a/flamenco_worker/patch_asyncio.py
+++ b/flamenco_worker/patch_asyncio.py
@@ -9,15 +9,19 @@ This prevents an error at the end of a subprocess execution:
 
 """
 
-import asyncio.unix_events as ue
-
 
 def patch_asyncio():
     import logging
+    import sys
 
     log = logging.getLogger(__name__)
+    if sys.platform == 'win32':
+        log.debug('Patching ue._UnixReadPipeTransport.resume_reading not needed on Windows')
+        return
+
     log.debug('Patching ue._UnixReadPipeTransport.resume_reading')
 
+    import asyncio.unix_events as ue
     orig_resume_reading = ue._UnixReadPipeTransport.resume_reading
 
     def resume_reading(self, *args, **kwargs):
-- 
GitLab