Pelagicore / gdbus-codegen-glibmm

Code generator for C++ D-Bus stubs and proxies using Giomm/Glibmm
GNU Lesser General Public License v2.1
23 stars 25 forks source link

SyntaxError: Missing parentheses in call to 'print' #4

Closed rpannek closed 6 years ago

rpannek commented 6 years ago

When running python setup.py install on master I'm getting a syntax error:

byte-compiling build/bdist.linux-x86_64/egg/codegen_glibmm/codegen.py to codegen.cpython-36.pyc
  File "build/bdist.linux-x86_64/egg/codegen_glibmm/codegen.py", line 227
    print "WARNING: signal %s has too many parameters, skipping" % s.name
                                                               ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print "WARNING: signal %s has too many parameters, skipping" % s.name)?

byte-compiling build/bdist.linux-x86_64/egg/codegen_glibmm/parser.py to parser.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/codegen_glibmm/codegen_main.py to codegen_main.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/codegen_glibmm/dbustypes.py to dbustypes.cpython-36.pyc
  File "build/bdist.linux-x86_64/egg/codegen_glibmm/dbustypes.py", line 120
    print "Unknown signature: " + self.signature
                              ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print "Unknown signature: " + self.signature)?
erikboto commented 6 years ago

It currently only supports python2, but the plan is to port it to python3 in the near future.

rpannek commented 6 years ago

This perhaps should be mentioned somewhere, now that many distributions ship python3 as the default python. And perhaps instead of assuming /usr/bin/python in the shebang you should do #!/usr/bin/env python2 that would make it at least explicit. Also with the setup example you might want to do python2 ./setup.py install instead.

erikboto commented 6 years ago

@rpannek I think the original issue with python3 as well as the additional comments about shebangs etc should all be addressed now. Can the issue be closed now?

rpannek commented 6 years ago

Very nice, thanks!