mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tests: Fix SafeConfigParser deprecation warning
@ 2022-09-26 14:53 James Clark
  0 siblings, 0 replies; only message in thread
From: James Clark @ 2022-09-26 14:53 UTC (permalink / raw)
  To: acme
  Cc: linux-kernel, linux-perf-users, James Clark, Peter Zijlstra,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim

The following command:

  perf test attr -vvv

Results in this deprecation warning:

  ./tests/attr.py:142: DeprecationWarning: The SafeConfigParser class
  has been renamed to ConfigParser in Python 3.2. This alias will be
  removed in future versions. Use ConfigParser directly instead.

The last Python 3.2 release was in 2013 and Rhel-6 has Python 3.3 so I
think it's safe to make the replacement now.

Tested with Python 3.8

Signed-off-by: James Clark <james.clark@arm.com>
---
 tools/perf/tests/attr.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
index cb39ac46bc73..6d9b5312e6c2 100644
--- a/tools/perf/tests/attr.py
+++ b/tools/perf/tests/attr.py
@@ -139,7 +139,7 @@ class Event(dict):
 #   - 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)
@@ -198,7 +198,7 @@ class Test(object):
         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,
@@ -212,7 +212,7 @@ class Test(object):
             # 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')
 
-- 
2.28.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-26 16:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 14:53 [PATCH] perf tests: Fix SafeConfigParser deprecation warning James Clark

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®