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 pprint import pformat
from urllib.request import FancyURLopener from urllib.request import FancyURLopener
from configparser import SafeConfigParser from configparser import ConfigParser
try: try:
import fcntl import fcntl
except ImportError: except ImportError:
@ -113,7 +113,7 @@ class Buildozer:
self.state = None self.state = None
self.build_id = None self.build_id = None
self.config_profile = '' 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.optionxform = lambda value: value
self.config.getlist = self._get_config_list self.config.getlist = self._get_config_list
self.config.getlistvalues = self._get_config_list_values 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 select import select
from os.path import join, expanduser, realpath, exists, splitext from os.path import join, expanduser, realpath, exists, splitext
from os import makedirs, walk, getcwd from os import makedirs, walk, getcwd
try: from configparser import ConfigParser
from configparser import SafeConfigParser
except ImportError:
from ConfigParser import SafeConfigParser
try: try:
import termios import termios
has_termios = True has_termios = True
@ -138,7 +135,7 @@ class BuildozerRemote(Buildozer):
# create custom buildozer.spec # create custom buildozer.spec
self.info('Create custom buildozer.spec') self.info('Create custom buildozer.spec')
config = SafeConfigParser() config = ConfigParser()
config.read('buildozer.spec') config.read('buildozer.spec')
config.set('app', 'source.dir', 'app') config.set('app', 'source.dir', 'app')