Skip to content

Commit

Permalink
use ConfigParser instead of SafeConfigParser
Browse files Browse the repository at this point in the history
The SafeConfigParser class has been renamed to ConfigParser in Python 3.2.
This alias will be removed in future versions. Using ConfigParser directly instead.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2001789
Signed-off-by: Sandro Bonazzola <[email protected]>
  • Loading branch information
sandrobonazzola committed Mar 2, 2022
1 parent c5b84f8 commit 1221fed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _setupAPI(self, funcs):
setattr(self, funcName, funcObj)

def _load_config(self, fname, overrides):
self.config = configparser.SafeConfigParser()
self.config = configparser.ConfigParser()

# Set built-in defaults
self.config.add_section('main')
Expand Down
2 changes: 1 addition & 1 deletion momd.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def signal_quit(signum, frame):
mom_instance.shutdown()

def get_option_overrides(options):
config = configparser.SafeConfigParser()
config = configparser.ConfigParser()
config.add_section('main')
config.add_section('logging')
if options.plot_dir is not None:
Expand Down
4 changes: 2 additions & 2 deletions tests/GeneralTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

def start_mom(config=None):
if not config:
config = configparser.SafeConfigParser()
config = configparser.ConfigParser()
config.add_section('logging')
config.set('logging', 'verbosity', 'error')

Expand Down Expand Up @@ -106,7 +106,7 @@ def testMultiplePolicies(self):
f.write(policy)


config = configparser.SafeConfigParser()
config = configparser.ConfigParser()
config.add_section('main')
config.set('main', 'policy-dir', policy_dir)
config.add_section('logging')
Expand Down

0 comments on commit 1221fed

Please sign in to comment.