SafeConfigParser deprecated (#1155)

SafeConfigParser deprecated.
SafeConfigParser was renamed to ConfigParser in Python 3.2. Use of it in Python 3.7 gives a DeprecationWarning.
As Buildozer is not supported at below Python 3.2, simply replaced all mentions.

Co-authored-by: Julian-O <kraken@somethinkodd.com>
This commit is contained in:
Julian 2020-06-15 21:40:25 +10:00 committed by GitHub
parent 40c79e5a93
commit a3704e7fb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View file

@ -28,7 +28,7 @@ from fnmatch import fnmatch
from pprint import pformat
from urllib.request import FancyURLopener
from configparser import SafeConfigParser
from configparser import ConfigParser
try:
import fcntl
except ImportError:
@ -113,7 +113,7 @@ class Buildozer:
self.state = None
self.build_id = None
self.config_profile = ''
self.config = SafeConfigParser(allow_no_value=True)
self.config = ConfigParser(allow_no_value=True)
self.config.optionxform = lambda value: value
self.config.getlist = self._get_config_list
self.config.getlistvalues = self._get_config_list_values

View file

@ -21,10 +21,7 @@ from sys import stdout, stdin, exit
from select import select
from os.path import join, expanduser, realpath, exists, splitext
from os import makedirs, walk, getcwd
try:
from configparser import SafeConfigParser
except ImportError:
from ConfigParser import SafeConfigParser
from configparser import ConfigParser
try:
import termios
has_termios = True
@ -138,7 +135,7 @@ class BuildozerRemote(Buildozer):
# create custom buildozer.spec
self.info('Create custom buildozer.spec')
config = SafeConfigParser()
config = ConfigParser()
config.read('buildozer.spec')
config.set('app', 'source.dir', 'app')