bindings: try importing collections.abc first for forward compatibility
authorChristophe Bedard <bedard.christophe@gmail.com>
Sat, 25 Apr 2020 02:54:45 +0000 (22:54 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 May 2020 16:21:43 +0000 (12:21 -0400)
commit64b7b73406242324460e4df149eff329b289192a
tree492e1da1cc6118a464dbca14ea9d0d5d9e2856a8
parent6cf823f6e01a23e85287b8a04bebb1d1a64c0d15
bindings: try importing collections.abc first for forward compatibility

Using the babeltrace Python module with Python 3.3-3.8 gives a warning:

/usr/lib/python3/dist-packages/babeltrace/babeltrace.py:811:
DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated since Python 3.3,
and in 3.9 it will stop working

Therefore, for forward compability (Python 3.9+), try importing it
using the new way first. Otherwise, fall back on the old way.

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
Change-Id: I7f650593a013643b2fb0b77b0d388cf57bc2b765
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/babeltrace/babeltrace.i.in
This page took 0.024384 seconds and 4 git commands to generate.