summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-10-09 15:25:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-10-09 17:04:24 +0200
commitf9d9a21d0271d3ddc689dfe12983ec6c96d8ccbc (patch)
tree7d84dc74f8bb589a91803cacce76612a522a5b65
parent396b12ec0b6c47a31e5f65784597bc3cf2803733 (diff)
Adapt solenv/gdb/ to old Python
After 4a899a5f8a72ea29a6919316afe3627de9f33e95 "Fix Python deprecation warnings"e.g. <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/70542/console> started to complain > Traceback (most recent call last): > File "/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/instdir/program/libuno_sal.so.3-gdb.py", line 23, in <module> > module = importlib.import_module('libreoffice.' + mod) > File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module > __import__(name) > File "/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/solenv/gdb/libreoffice/sal.py", line 14, in <module> > from libreoffice.util import printing > File "/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/solenv/gdb/libreoffice/util/printing.py", line 10, in <module> > from collections.abc import Mapping > ImportError: No module named abc etc. when lode's bin/kill-wrapper calls gdb to obtain backtraces of hung processes. Change-Id: I4fe6c6fa97bbb455a071dd28e5c1ab33f2337a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104119 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--solenv/gdb/boost/util/printing.py5
-rw-r--r--solenv/gdb/libreoffice/util/printing.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/solenv/gdb/boost/util/printing.py b/solenv/gdb/boost/util/printing.py
index 85a91c9340a4..22bf29f8030a 100644
--- a/solenv/gdb/boost/util/printing.py
+++ b/solenv/gdb/boost/util/printing.py
@@ -19,7 +19,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from collections.abc import Mapping
+try:
+ from collections.abc import Mapping
+except:
+ from collections import Mapping
import gdb
import re
import six
diff --git a/solenv/gdb/libreoffice/util/printing.py b/solenv/gdb/libreoffice/util/printing.py
index 30e311678025..a31e353cfa4d 100644
--- a/solenv/gdb/libreoffice/util/printing.py
+++ b/solenv/gdb/libreoffice/util/printing.py
@@ -7,7 +7,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-from collections.abc import Mapping
+try:
+ from collections.abc import Mapping
+except:
+ from collections import Mapping
import gdb
import re
import six