mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 10:56:49 +00:00
Switch to new configparser backport.
This commit is contained in:
parent
f0657aec69
commit
f50fd8e474
3
setup.py
3
setup.py
@ -131,6 +131,9 @@ install_requires = [
|
||||
|
||||
# Linux distribution detection:
|
||||
"distro >= 1.4.0",
|
||||
|
||||
# Backported configparser for Python 2:
|
||||
"configparser >= 5.0.1 ; python_version < '3.0'",
|
||||
]
|
||||
|
||||
setup_requires = [
|
||||
|
@ -2,10 +2,9 @@ import os, stat, time, weakref
|
||||
from base64 import urlsafe_b64encode
|
||||
from functools import partial
|
||||
from errno import ENOENT, EPERM
|
||||
try:
|
||||
from ConfigParser import NoSectionError
|
||||
except ImportError:
|
||||
from configparser import NoSectionError
|
||||
|
||||
# On Python 2 this will be the backported package:
|
||||
from configparser import NoSectionError
|
||||
|
||||
from foolscap.furl import (
|
||||
decode_furl,
|
||||
|
@ -13,8 +13,9 @@ from io import StringIO
|
||||
import tempfile
|
||||
from base64 import b32decode, b32encode
|
||||
|
||||
# Python 2 compatibility
|
||||
from six.moves import configparser
|
||||
# On Python 2 this will be the backported package.
|
||||
import configparser
|
||||
|
||||
from future.utils import PY2
|
||||
if PY2:
|
||||
from io import BytesIO as StringIO # noqa: F811
|
||||
|
@ -8,7 +8,9 @@ from os.path import join
|
||||
from future.utils import PY2
|
||||
if PY2:
|
||||
from future.builtins import str # noqa: F401
|
||||
from six.moves.configparser import NoSectionError
|
||||
|
||||
# On Python 2 this will be the backported package:
|
||||
from configparser import NoSectionError
|
||||
|
||||
from twisted.python import usage
|
||||
|
||||
|
@ -31,12 +31,10 @@ the foolscap-based server implemented in src/allmydata/storage/*.py .
|
||||
from past.builtins import unicode
|
||||
|
||||
import re, time, hashlib
|
||||
try:
|
||||
from ConfigParser import (
|
||||
NoSectionError,
|
||||
)
|
||||
except ImportError:
|
||||
from configparser import NoSectionError
|
||||
|
||||
# On Python 2 this will be the backport.
|
||||
from configparser import NoSectionError
|
||||
|
||||
import attr
|
||||
from zope.interface import (
|
||||
Attribute,
|
||||
|
@ -16,13 +16,9 @@ if PY2:
|
||||
# we do "r" or "w".
|
||||
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
||||
|
||||
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
|
||||
# On Python 2 we use the backport package; that means we always get unicode
|
||||
# out.
|
||||
from configparser import SafeConfigParser
|
||||
|
||||
import attr
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user