fcd icon indicating copy to clipboard operation
fcd copied to clipboard

Using 'python' binary for Python 2

Open zatherz opened this issue 8 years ago • 3 comments

PEP 394 recommends the usage of python2 when invoking Python 2 scripts instead of python, as the latter might be different depending on the distribution (and indeed it is - it's Python 3 in Arch Linux).

zatherz avatar Apr 29 '17 19:04 zatherz

Which script(s) are you talking about?

fay59 avatar Apr 30 '17 16:04 fay59

Upon further inspection, it seems that it's actually cmake generating it like that.

[  3%] Built target emu
[  4%] Generating bindings.cpp
  File "/home/zatherz/fcd/fcd/python/bindings.py", line 131
    raise ValueError, "callback type %s" % cFunction.returnType
                    ^
SyntaxError: invalid syntax
make[2]: *** [CMakeFiles/fcd.dir/build.make:62: bindings.cpp] Error 1
make[2]: *** Deleting file 'bindings.cpp'
make[1]: *** [CMakeFiles/Makefile2:67: CMakeFiles/fcd.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

zatherz avatar Apr 30 '17 23:04 zatherz

The script comes from fcd/python/bindings.py (but doesn't have a shebang). It might not be a ton of effort to make it 2-3 compatible. Would you like to do it?

With that said, fcd itself is likely to keep linking against Python 2 for a while.

fay59 avatar May 01 '17 01:05 fay59