Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate off SafeConfigParser #196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions stdeb/cli_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
import shutil
import subprocess
import sys
try:
# python 2.x
from ConfigParser import SafeConfigParser # noqa: F401
except ImportError:
# python 3.x
from configparser import SafeConfigParser # noqa: F401
from configparser import ConfigParser # noqa: F401
from distutils.util import strtobool
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from stdeb.util import stdeb_cmdline_opts, stdeb_cmd_bool_opts
Expand Down
13 changes: 4 additions & 9 deletions stdeb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
import sys
import time
import codecs
try:
# Python 2.x
import ConfigParser
except ImportError:
# Python 3.x
import configparser as ConfigParser
import configparser as ConfigParser
import subprocess
import tempfile
import stdeb # noqa: F401
Expand Down Expand Up @@ -732,7 +727,7 @@ def check_cfg_files(cfg_files, module_name):
example.
"""

cfg = ConfigParser.SafeConfigParser()
cfg = ConfigParser.ConfigParser()
cfg.read(cfg_files)
if cfg.has_section(module_name):
section_items = cfg.items(module_name)
Expand Down Expand Up @@ -803,10 +798,10 @@ def __init__(self,
if len(cfg_files):
check_cfg_files(cfg_files, module_name)

cfg = ConfigParser.SafeConfigParser(cfg_defaults)
cfg = ConfigParser.ConfigParser(cfg_defaults)
for cfg_file in cfg_files:
with codecs.open(cfg_file, mode='r', encoding='utf-8') as fd:
cfg.readfp(fd)
cfg.read_file(fd)

if sdist_dsc_command is not None:
# Allow distutils commands to override config files (this lets
Expand Down