mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-25 01:02:19 +00:00
Fix for #711.
This commit is contained in:
parent
b41affa267
commit
d4fdee1e9f
2 changed files with 7 additions and 3 deletions
|
@ -5,6 +5,7 @@ import os
|
||||||
from simpleconfigparser import simpleconfigparser
|
from simpleconfigparser import simpleconfigparser
|
||||||
|
|
||||||
from get_args import args
|
from get_args import args
|
||||||
|
from six import PY3
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
'general': {
|
'general': {
|
||||||
|
@ -139,7 +140,10 @@ defaults = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
settings = simpleconfigparser(defaults=defaults)
|
if PY3:
|
||||||
|
settings = simpleconfigparser(defaults=defaults, interpolation=None)
|
||||||
|
else:
|
||||||
|
settings = simpleconfigparser(defaults=defaults)
|
||||||
settings.read(os.path.join(args.config_dir, 'config', 'config.ini'))
|
settings.read(os.path.join(args.config_dir, 'config', 'config.ini'))
|
||||||
|
|
||||||
base_url = settings.general.base_url
|
base_url = settings.general.base_url
|
||||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||||
try:
|
try:
|
||||||
from configparser import ConfigParser as configparser, NoOptionError, NoSectionError
|
from configparser import ConfigParser as configparser, NoOptionError, NoSectionError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ConfigParser import SafeConfigParser as configparser, NoOptionError, NoSectionError
|
from ConfigParser import RawConfigParser as configparser, NoOptionError, NoSectionError
|
||||||
|
|
||||||
|
|
||||||
class simpleconfigparser(configparser):
|
class simpleconfigparser(configparser):
|
||||||
|
@ -126,6 +126,6 @@ class simpleconfigparser(configparser):
|
||||||
def get(self, section, option, raw=False, vars=None, fallback=None):
|
def get(self, section, option, raw=False, vars=None, fallback=None):
|
||||||
try:
|
try:
|
||||||
# Strip out quotes from the edges
|
# Strip out quotes from the edges
|
||||||
return configparser.get(self, section, option, raw=raw, vars=vars).strip('"\'')
|
return configparser.get(self, section, option).strip('"\'')
|
||||||
except NoOptionError:
|
except NoOptionError:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue