Hey all.

While the GNOME 3.6 release was a Python 3 drill, the GNOME 3.8 release
will be Python 3 for real as per the Release Team's announcement last
night. As a result, I'm now testing Orca with brltty and brlapi built
for Python 3 and will either tweak in Orca or submit patches here as
appropriate.

Attached is the first patch that needs to be done on your end. Without
it, I cannot build the Python 3 bindings. The print function is required
in Python 3. It was backported to Python 2.6 and later. So this patch is
compatible as long as people are not using an ancient version of Python
2. :)

On the Orca side, I have just committed a change to Orca master to use
Byte strings instead of the new, Python 3 default which is Unicode
strings. With any luck, that will make it unnecessary for whatever
Luke's hack had been.

I'm still testing and will keep y'all posted! :)

Thanks and take care.
--joanie
Index: Bindings/Python/bindings.m4
===================================================================
--- Bindings/Python/bindings.m4	(revision 6709)
+++ Bindings/Python/bindings.m4	(working copy)
@@ -43,10 +43,10 @@
    then
       if test -z "${PYTHON_VERSION}"
       then
-         [PYTHON_VERSION="`${PYTHON} -c "${PYTHON_PROLOGUE} print distutils.sysconfig.get_config_vars('VERSION')[0];"`"]
+         [PYTHON_VERSION="`${PYTHON} -c "${PYTHON_PROLOGUE} print(distutils.sysconfig.get_config_vars('VERSION')[0]);"`"]
          if test -z "${PYTHON_VERSION}"
          then
-            [PYTHON_VERSION="`${PYTHON} -c "${PYTHON_PROLOGUE} print '.'.join(sys.version.split()[0].split('.')[:2]);"`"]
+            [PYTHON_VERSION="`${PYTHON} -c "${PYTHON_PROLOGUE} print('.'.join(sys.version.split()[0].split('.')[:2]));"`"]
             if test -z "${PYTHON_VERSION}"
             then
                AC_MSG_WARN([Python version not defined])
@@ -57,7 +57,7 @@
 
       if test -z "${PYTHON_CPPFLAGS}"
       then
-         [python_include_directory="`${PYTHON} -c "${PYTHON_PROLOGUE} print distutils.sysconfig.get_python_inc();"`"]
+         [python_include_directory="`${PYTHON} -c "${PYTHON_PROLOGUE} print(distutils.sysconfig.get_python_inc());"`"]
          if test -z "${python_include_directory}"
          then
             AC_MSG_WARN([Python include directory not found])
@@ -78,7 +78,7 @@
       then
          PYTHON_LIBS="-lpython${PYTHON_VERSION}"
 
-         [python_library_directory="`${PYTHON} -c "${PYTHON_PROLOGUE} print distutils.sysconfig.get_python_lib(0,1);"`"]
+         [python_library_directory="`${PYTHON} -c "${PYTHON_PROLOGUE} print(distutils.sysconfig.get_python_lib(0,1));"`"]
          if test -z "${python_library_directory}"
          then
             AC_MSG_WARN([Python library directory not found])
@@ -90,19 +90,19 @@
 
       if test -z "${PYTHON_EXTRA_LIBS}"
       then
-         [PYTHON_EXTRA_LIBS="`${PYTHON} -c "${PYTHON_PROLOGUE} print distutils.sysconfig.get_config_var('LOCALMODLIBS'), distutils.sysconfig.get_config_var('LIBS');"`"]
+         [PYTHON_EXTRA_LIBS="`${PYTHON} -c "${PYTHON_PROLOGUE} print(distutils.sysconfig.get_config_var('LOCALMODLIBS'), distutils.sysconfig.get_config_var('LIBS'));"`"]
       fi
       AC_SUBST([PYTHON_EXTRA_LIBS])
 
       if test -z "${PYTHON_EXTRA_LDFLAGS}"
       then
-         [PYTHON_EXTRA_LDFLAGS="`${PYTHON} -c "${PYTHON_PROLOGUE} print distutils.sysconfig.get_config_var('LINKFORSHARED');"`"]
+         [PYTHON_EXTRA_LDFLAGS="`${PYTHON} -c "${PYTHON_PROLOGUE} print(distutils.sysconfig.get_config_var('LINKFORSHARED'));"`"]
       fi
       AC_SUBST([PYTHON_EXTRA_LDFLAGS])
 
       if test -z "${PYTHON_SITE_PKG}"
       then
-         [PYTHON_SITE_PKG="`${PYTHON} -c "${PYTHON_PROLOGUE} print distutils.sysconfig.get_python_lib(0,0);"`"]
+         [PYTHON_SITE_PKG="`${PYTHON} -c "${PYTHON_PROLOGUE} print(distutils.sysconfig.get_python_lib(0,0));"`"]
          if test -z "${PYTHON_SITE_PKG}"
          then
             AC_MSG_WARN([Python package directory not found])
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: [email protected]
For general information, go to: http://mielke.cc/mailman/listinfo/brltty

Reply via email to