diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-07-28 12:11:20 +0300 |
---|---|---|
committer | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-07-28 15:23:39 +0200 |
commit | dffa7b7d0b6553a5b37081cd164d3ffc0b215040 (patch) | |
tree | 3454e7fcbcd3be877c4ab691062b4bd159967954 /solenv/gdb/libreoffice | |
parent | 85511e27d259d6b19cc6c463fc06368c14511bb8 (diff) |
sfx2, solenv, sw: fix issues found by Ruff linter
Change-Id: Iab375e8c8aa4c4915f3c70a9ef6aede268e4619f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171138
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'solenv/gdb/libreoffice')
-rw-r--r-- | solenv/gdb/libreoffice/cppu.py | 2 | ||||
-rw-r--r-- | solenv/gdb/libreoffice/sw.py | 10 | ||||
-rw-r--r-- | solenv/gdb/libreoffice/util/printing.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py index 5114dbe127d5..c5b257b72b5d 100644 --- a/solenv/gdb/libreoffice/cppu.py +++ b/solenv/gdb/libreoffice/cppu.py @@ -43,7 +43,7 @@ class UnoReferencePrinter(object): if iface: try: return '%s to (%s) %s' % (self.typename, str(iface.dynamic_type), str(iface)) - except: + except Exception: # fallback for potential problem: # base class 'com::sun::star::uno::XInterface' is ambiguous return '%s to (XInterface) %s' % (self.typename, str(iface)) diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py index 89ac80e5eb2a..1f8b8c1636e2 100644 --- a/solenv/gdb/libreoffice/sw.py +++ b/solenv/gdb/libreoffice/sw.py @@ -19,8 +19,8 @@ class SwPositionPrinter(object): self.value = value def to_string(self): - node = self.value['nNode']['m_pNode'].dereference(); - block = node['m_pBlock'].dereference(); + node = self.value['nNode']['m_pNode'].dereference() + block = node['m_pBlock'].dereference() nodeindex = block['nStart'] + node['m_nOffset'] offset = self.value['nContent']['m_nIndex'] return "%s (node %d, offset %d)" % (self.typename, nodeindex, offset) @@ -33,8 +33,8 @@ class SwNodeIndexPrinter(object): self.value = value def to_string(self): - node = self.value['m_pNode'].dereference(); - block = node['m_pBlock'].dereference(); + node = self.value['m_pNode'].dereference() + block = node['m_pBlock'].dereference() nodeindex = block['nStart'] + node['m_nOffset'] return "%s (node %d)" % (self.typename, nodeindex) @@ -50,7 +50,7 @@ class SwContentIndexPrinter(object): nodeindex = 'none' if pNode: node = pNode.dereference() - block = node['m_pBlock'].dereference(); + block = node['m_pBlock'].dereference() nodeindex = str(block['nStart'] + node['m_nOffset']) offset = self.value['m_nIndex'] return "%s (node %s offset %s)" % (self.typename, nodeindex, offset) diff --git a/solenv/gdb/libreoffice/util/printing.py b/solenv/gdb/libreoffice/util/printing.py index a31e353cfa4d..f50a427cc091 100644 --- a/solenv/gdb/libreoffice/util/printing.py +++ b/solenv/gdb/libreoffice/util/printing.py @@ -9,7 +9,7 @@ try: from collections.abc import Mapping -except: +except Exception: from collections import Mapping import gdb import re |