mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
Use Python 2 ConfigParser, so correct exceptions get raised.
This commit is contained in:
parent
277298050f
commit
10378541d7
@ -7,10 +7,17 @@ from future.utils import PY2
|
||||
if PY2:
|
||||
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
||||
|
||||
from configparser import SafeConfigParser
|
||||
if PY2:
|
||||
# In theory on Python 2 configparser also works, but then code gets the
|
||||
# wrong exceptions and they don't get handled. So just use native parser
|
||||
# for now.
|
||||
from ConfigParser import SafeConfigParser
|
||||
else:
|
||||
from configparser import SafeConfigParser
|
||||
|
||||
import attr
|
||||
|
||||
|
||||
class UnknownConfigError(Exception):
|
||||
"""
|
||||
An unknown config item was found.
|
||||
|
Loading…
Reference in New Issue
Block a user