From 81771264e0a39795ce081984bb806ee4d30e4c97 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 13 Apr 2018 22:05:08 +0200 Subject: [PATCH] CREATE_NO_WINDOW was introduced in Python 3.7 and didn't exist before --- jedi/_compatibility.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 573b90bd..cec07a4c 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -507,5 +507,10 @@ class GeneralizedPopen(subprocess.Popen): def __init__(self, *args, **kwargs): creation_flags = 0 if os.name == 'nt': - creation_flags = subprocess.CREATE_NO_WINDOW + try: + # Was introduced in Python 3.7. + CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW + except AttributeError: + CREATE_NO_WINDOW = 0x08000000 + creation_flags = CREATE_NO_WINDOW super(GeneralizedPopen, self).__init__(*args, creationflags=creation_flags, **kwargs)