Skip to content

Commit 75438f2

Browse files
captain5050acmel
authored andcommitted
perf test attr: Fix python SafeConfigParser() deprecation warning
Address the warning: ``` tests/attr.py:155: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in Python 3.12. Use ConfigParser directly instead. parser = configparser.SafeConfigParser() ``` by removing the word 'Safe'. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Richter <tmricht@linux.ibm.com> Link: https://lore.kernel.org/r/20230517225707.2682235-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 951efb9 commit 75438f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/perf/tests/attr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def parse_version(version):
152152
# - expected values assignments
153153
class Test(object):
154154
def __init__(self, path, options):
155-
parser = configparser.SafeConfigParser()
155+
parser = configparser.ConfigParser()
156156
parser.read(path)
157157

158158
log.warning("running '%s'" % path)
@@ -247,7 +247,7 @@ def skip_test_arch(self, myarch):
247247
return True
248248

249249
def load_events(self, path, events):
250-
parser_event = configparser.SafeConfigParser()
250+
parser_event = configparser.ConfigParser()
251251
parser_event.read(path)
252252

253253
# The event record section header contains 'event' word,
@@ -261,7 +261,7 @@ def load_events(self, path, events):
261261
# Read parent event if there's any
262262
if (':' in section):
263263
base = section[section.index(':') + 1:]
264-
parser_base = configparser.SafeConfigParser()
264+
parser_base = configparser.ConfigParser()
265265
parser_base.read(self.test_dir + '/' + base)
266266
base_items = parser_base.items('event')
267267

0 commit comments

Comments
 (0)