Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows popup windows #17

Closed
klonuo opened this issue Mar 18, 2013 · 2 comments
Closed

Windows popup windows #17

klonuo opened this issue Mar 18, 2013 · 2 comments

Comments

@klonuo
Copy link
Contributor

klonuo commented Mar 18, 2013

Hi,

on Windows your plugin pops console windows while working, and this is standard workaround:

--- sublime_jedi.bak
+++ sublime_jedi.py
@@ -25,8 +25,14 @@ def get_sys_path(python_interpreter):

         :return: list
     """
-    command = [python_interpreter, '-c', "import sys; print sys.path"]
-    process = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE)
+    command = [python_interpreter, '-c', "import sys; print(sys.path)"]
+    if sys.platform == "win32":
+        startupinfo = subprocess.STARTUPINFO()
+        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+        process = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE,
+                                   startupinfo=startupinfo)
+    else:
+        process = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE)
     out = process.communicate()[0]
     sys_path = json.loads(out.replace("'", '"'))
     return sys_path
@srusskih
Copy link
Owner

Hi. Can the fix waits until #16 be done?

@klonuo
Copy link
Contributor Author

klonuo commented Mar 18, 2013

Sure, whenever. As this patch just adds one additional flag for win32 subprocess calls, you can easily apply it when you find it appropriate.

Cheers

srusskih added a commit that referenced this issue Mar 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants