From c4b1b814fab3f5c7617890ef46959b43c415cba1 Mon Sep 17 00:00:00 2001 From: empyrical Date: Thu, 17 Sep 2015 02:05:49 -0600 Subject: Fix subprocess.mswindows check for Python 3.5 --- popenasync.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'popenasync.py') diff --git a/popenasync.py b/popenasync.py index df4944ee7..78ae1cbf3 100644 --- a/popenasync.py +++ b/popenasync.py @@ -23,7 +23,12 @@ if sys.version_info >= (3,): else: null_byte = '\x00' -if subprocess.mswindows: +if hasattr(subprocess, 'mswindows'): + mswindows = subprocess.mswindows +else: + mswindows = subprocess._mswindows + +if mswindows: if sys.version_info >= (3,): # Test date should be in ascii. def encode(s): @@ -142,7 +147,7 @@ class Popen(subprocess.Popen): getattr(self, which).close() setattr(self, which, None) - if subprocess.mswindows: + if mswindows: def kill(self): # Recipes #http://me.in-berlin.de/doc/python/faq/windows.html#how-do-i-emulate-os-kill-in-windows -- cgit v1.2.3