mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Refactor something small
This commit is contained in:
@@ -505,12 +505,11 @@ except ImportError:
|
|||||||
|
|
||||||
class GeneralizedPopen(subprocess.Popen):
|
class GeneralizedPopen(subprocess.Popen):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
creation_flags = 0
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
try:
|
try:
|
||||||
# Was introduced in Python 3.7.
|
# Was introduced in Python 3.7.
|
||||||
CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW
|
CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
CREATE_NO_WINDOW = 0x08000000
|
CREATE_NO_WINDOW = 0x08000000
|
||||||
creation_flags = CREATE_NO_WINDOW
|
kwargs['creation_flags'] = CREATE_NO_WINDOW
|
||||||
super(GeneralizedPopen, self).__init__(*args, creationflags=creation_flags, **kwargs)
|
super(GeneralizedPopen, self).__init__(*args, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user