* GDB port to python3?
@ 2011-01-17 20:28 Jan Kratochvil
0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2011-01-17 20:28 UTC (permalink / raw)
To: David Malcolm; +Cc: archer
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
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
[-- Attachment #2: python3.diff --]
[-- Type: text/plain, Size: 1500 bytes --]
--- 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))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-17 20:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 20:28 GDB port to python3? Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).