From: Leo Yan <leo.yan@arm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Aishwarya TCV <aishwarya.tcv@arm.com>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Leo Yan <leo.yan@arm.com>
Subject: [PATCH v2 4/4] perf python: Avoid shadowing exception name in PostgreSQL exporter
Date: Wed, 30 Sep 2026 14:11:39 +0100 [thread overview]
Message-ID: <20260930-perf_fix_pylint_errors-v2-4-945cd526576b@arm.com> (raw)
In-Reply-To: <20260930-perf_fix_pylint_errors-v2-0-945cd526576b@arm.com>
During the perf build, pylint reports:
************* Module export-to-postgresql
python/export-to-postgresql.py:319:8: W0621: Redefining name 'e' from outer scope (line 100) (redefined-outer-name)
Rename 'e' to 'db_error' to clear the warning.
Fixes: b1f968c9656a ("perf python: Port export-to-postgresql to perf module")
Assisted-by: Codex:gpt-6
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/perf/python/export-to-postgresql.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/python/export-to-postgresql.py b/tools/perf/python/export-to-postgresql.py
index b6782129354ed3b1bd750af41e7a002c7134bf12..9cac64dee361214de3d1f9907c5e6849327c8ed7 100755
--- a/tools/perf/python/export-to-postgresql.py
+++ b/tools/perf/python/export-to-postgresql.py
@@ -316,9 +316,9 @@ class PostgresExporter:
# SQL identifiers are double-quoted; escape embedded double quotes by doubling them.
db_name = self.dbname.replace('"', '""')
self.do_query(f'CREATE DATABASE "{db_name}"')
- except Exception as e:
+ except Exception as db_error:
shutil.rmtree(self.output_dir_name, ignore_errors=True)
- raise e
+ raise db_error
self.disconnect()
self.connect(self.dbname)
--
2.34.1
next prev parent reply other threads:[~2026-09-30 13:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 13:11 [PATCH v2 0/4] perf build: Fix pylint build failures Leo Yan
2026-09-30 13:11 ` [PATCH v2 1/4] perf build: Build the Python extension before pylint consumers Leo Yan
2026-09-30 17:44 ` Ian Rogers
2026-09-30 13:11 ` [PATCH v2 2/4] perf build: Add the output Python directory to pylint's PYTHONPATH Leo Yan
2026-09-30 17:45 ` Ian Rogers
2026-09-30 13:11 ` [PATCH v2 3/4] perf test: Suppress optparse deprecation warning with older pylint Leo Yan
2026-09-30 17:39 ` Ian Rogers
2026-09-30 13:11 ` Leo Yan [this message]
2026-09-30 17:46 ` [PATCH v2 4/4] perf python: Avoid shadowing exception name in PostgreSQL exporter Ian Rogers
2026-09-30 17:52 ` [PATCH v2 0/4] perf build: Fix pylint build failures Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260930-perf_fix_pylint_errors-v2-4-945cd526576b@arm.com \
--to=leo.yan@arm.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=aishwarya.tcv@arm.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®