This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GDB port to python3?

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/ --libs
	  File "./python/", line 15
	SyntaxError: invalid syntax

Thanks for info,
--- a/gdb/python/
+++ b/gdb/python/
@@ -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)
@@ -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':
-        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'))
-        print ' '.join(libs)
+        print(' '.join(libs))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]