Add a way to generalize Popen

This commit is contained in:
Dave Halter committed 2018-04-13 10:17:30 +02:00
1 parent 81623c6b5d
commit 83d635cbac
3 files changed
+14 -4

No files matched your search

+9
View File
@@ -10,6 +10,7 @@ import re
import pkgutil
import warnings
import inspect
import subprocess
try:
import importlib
except ImportError:
@@ -500,3 +501,11 @@ except ImportError:
VAR_POSITIONAL = object()
KEYWORD_ONLY = object()
VAR_KEYWORD = object()
class GeneralizedPopen(subprocess.Popen):
def __init__(self, *args, **kwargs):
creation_flags = 0
if os.name == 'nt':
creation_flags = subprocess.CREATE_NO_WINDOW
super(GeneralizedPopen, self).__init__(*args, creation_flags=creation_flags, **kwargs)