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