Just installed 0.10.10 and installed the code shell command:
$ code --help
File "<string>", line 1
import os,sys; print os.path.realpath(sys.argv[1])
^
SyntaxError: invalid syntax
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory
VS Code itself works fine if I launch it via Spotlight.
I believe the problem is that I had a Python virtual environment active, and python points to Python 3. If I try code outside of that virtualenv, where python means Python 2, everything works fine.
I guess the options are:
from __future__ import print_function and update the print statements accordingly.)Interesting. We only use Python on OS X btw, since there is no easy way to have realpath in there.
70ab81b should fix it
@joaomoreno - Wouldn't it be better to go with option 1, per my earlier comment?
https://github.com/Microsoft/vscode/commit/70ab81b95eebca26dd5465b3d0b8e094140b5a4b will still break on systems where the system Python is Python 3, like Fedora.
As I said 2 comments above, Python is only used in OS X.
Oh sorry, I misunderstood what you were saying. This should work. :+1:
... and looking at the file that is in question, resources/darwin/bin/code.sh, that should've been obvious to me from the start. Derp. :sheep:
No worries, thanks for keeping an eye out!
Workaround: open /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code and change python to /usr/bin/python.
You could also call print with parentheses which is compatible with both python 2 and 3.
print(os.path.realpath(sys.argv[1]))
Most helpful comment
You could also call print with parentheses which is compatible with both python 2 and 3.