use SafeConfigParser or ConfigParser, which is available
This commit is contained in:
parent
605f205a44
commit
909b9f2c8e
|
@ -27,10 +27,15 @@ from network.asyncore_pollchoose import set_rates
|
||||||
from tr import _translate
|
from tr import _translate
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
SafeConfigParser = configparser.SafeConfigParser
|
||||||
|
except AttributeError:
|
||||||
|
SafeConfigParser = configparser.ConfigParser
|
||||||
|
|
||||||
def getSOCKSProxyType(config):
|
def getSOCKSProxyType(config):
|
||||||
"""Get user socksproxytype setting from *config*"""
|
"""Get user socksproxytype setting from *config*"""
|
||||||
try:
|
try:
|
||||||
result = configparser.SafeConfigParser.get(
|
result = SafeConfigParser.get(
|
||||||
config, 'bitmessagesettings', 'socksproxytype')
|
config, 'bitmessagesettings', 'socksproxytype')
|
||||||
except (configparser.NoSectionError, configparser.NoOptionError):
|
except (configparser.NoSectionError, configparser.NoOptionError):
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -16,7 +16,10 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from pybitmessage import state
|
from pybitmessage import state
|
||||||
|
|
||||||
|
try:
|
||||||
SafeConfigParser = configparser.SafeConfigParser
|
SafeConfigParser = configparser.SafeConfigParser
|
||||||
|
except AttributeError:
|
||||||
|
SafeConfigParser = configparser.ConfigParser
|
||||||
config_ready = Event()
|
config_ready = Event()
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user