GDB port to python3?
Jan Kratochvil
jan.kratochvil@redhat.com
Mon Jan 17 20:28:00 GMT 2011
Hi David,
do you recommend porting GDB to python3 (python-3.2, for Fedora 15)?
During my quick test [attached] the GDB python sources probably have to become
backward incompatible with python-2.x, do they have to?
python2.7 ./python/python-config.py --libs
File "./python/python-config.py", line 15
file=sys.stderr)
^
SyntaxError: invalid syntax
Thanks for info,
Jan
-------------- next part --------------
--- a/gdb/python/python-config.py
+++ b/gdb/python/python-config.py
@@ -10,8 +10,9 @@ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']
def exit_with_usage(code=1):
- print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
- '|'.join('--'+opt for opt in valid_opts))
+ print("Usage: %s [%s]" % (sys.argv[0],
+ '|'.join('--'+opt for opt in valid_opts)),
+ file=sys.stderr)
sys.exit(code)
try:
@@ -32,17 +33,17 @@ if '--help' in opt_flags:
for opt in opt_flags:
if opt == '--prefix':
- print sysconfig.PREFIX
+ print(sysconfig.PREFIX)
elif opt == '--exec-prefix':
- print sysconfig.EXEC_PREFIX
+ print(sysconfig.EXEC_PREFIX)
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
- print ' '.join(flags)
+ print(' '.join(flags))
elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
@@ -53,5 +54,5 @@ for opt in opt_flags:
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
libs.extend(getvar('LINKFORSHARED').split())
- print ' '.join(libs)
+ print(' '.join(libs))
More information about the Archer
mailing list