mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
only use pythonw.exe on Windows platform and display error in Sublime Console instead of using python.exe
This commit is contained in:
parent
5616206b48
commit
78a7e5cbcb
20
WakaTime.py
20
WakaTime.py
@ -91,14 +91,14 @@ def prompt_api_key():
|
||||
def python_binary():
|
||||
python = 'python'
|
||||
if platform.system() == 'Windows':
|
||||
python = 'pythonw'
|
||||
try:
|
||||
Popen([python, '--version'])
|
||||
except:
|
||||
for path in glob.iglob('/python*'):
|
||||
if exists(realpath(join(path, 'pythonw.exe'))):
|
||||
python = realpath(join(path, 'pythonw'))
|
||||
break
|
||||
return realpath(join(path, 'pythonw'))
|
||||
try:
|
||||
python = 'pythonw'
|
||||
Popen([python, '--version'])
|
||||
except:
|
||||
python = None
|
||||
return python
|
||||
|
||||
|
||||
@ -166,9 +166,13 @@ class SendActionThread(threading.Thread):
|
||||
print(cmd)
|
||||
code = wakatime.main(cmd)
|
||||
if code != 0:
|
||||
print('Error: Response code %d from wakatime package' % code)
|
||||
print('Error: Response code %d from wakatime package.' % code)
|
||||
else:
|
||||
cmd.insert(0, python_binary())
|
||||
python = python_binary()
|
||||
if not python:
|
||||
print('Error: Could not find python binary.')
|
||||
else:
|
||||
cmd.insert(0, python)
|
||||
if self.debug:
|
||||
print(cmd)
|
||||
if platform.system() == 'Windows':
|
||||
|
Loading…
Reference in New Issue
Block a user