Skip to content

Commit

Permalink
perf test attr: Fix python SafeConfigParser() deprecation warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Rogers authored and Arnaldo Carvalho de Melo committed May 19, 2023
1 parent 951efb9 commit 75438f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/perf/tests/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def parse_version(version):
# - expected values assignments
class Test(object):
def __init__(self, path, options):
parser = configparser.SafeConfigParser()
parser = configparser.ConfigParser()
parser.read(path)

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

def load_events(self, path, events):
parser_event = configparser.SafeConfigParser()
parser_event = configparser.ConfigParser()
parser_event.read(path)

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

Expand Down

0 comments on commit 75438f2

Please sign in to comment.