mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 07:48:11 +00:00
Switch to new configparser backport.
This commit is contained in:
3
setup.py
3
setup.py
@ -131,6 +131,9 @@ install_requires = [
|
|||||||
|
|
||||||
# Linux distribution detection:
|
# Linux distribution detection:
|
||||||
"distro >= 1.4.0",
|
"distro >= 1.4.0",
|
||||||
|
|
||||||
|
# Backported configparser for Python 2:
|
||||||
|
"configparser >= 5.0.1 ; python_version < '3.0'",
|
||||||
]
|
]
|
||||||
|
|
||||||
setup_requires = [
|
setup_requires = [
|
||||||
|
@ -2,10 +2,9 @@ import os, stat, time, weakref
|
|||||||
from base64 import urlsafe_b64encode
|
from base64 import urlsafe_b64encode
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from errno import ENOENT, EPERM
|
from errno import ENOENT, EPERM
|
||||||
try:
|
|
||||||
from ConfigParser import NoSectionError
|
# On Python 2 this will be the backported package:
|
||||||
except ImportError:
|
from configparser import NoSectionError
|
||||||
from configparser import NoSectionError
|
|
||||||
|
|
||||||
from foolscap.furl import (
|
from foolscap.furl import (
|
||||||
decode_furl,
|
decode_furl,
|
||||||
|
@ -13,8 +13,9 @@ from io import StringIO
|
|||||||
import tempfile
|
import tempfile
|
||||||
from base64 import b32decode, b32encode
|
from base64 import b32decode, b32encode
|
||||||
|
|
||||||
# Python 2 compatibility
|
# On Python 2 this will be the backported package.
|
||||||
from six.moves import configparser
|
import configparser
|
||||||
|
|
||||||
from future.utils import PY2
|
from future.utils import PY2
|
||||||
if PY2:
|
if PY2:
|
||||||
from io import BytesIO as StringIO # noqa: F811
|
from io import BytesIO as StringIO # noqa: F811
|
||||||
|
@ -8,7 +8,9 @@ from os.path import join
|
|||||||
from future.utils import PY2
|
from future.utils import PY2
|
||||||
if PY2:
|
if PY2:
|
||||||
from future.builtins import str # noqa: F401
|
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
|
from twisted.python import usage
|
||||||
|
|
||||||
|
@ -31,12 +31,10 @@ the foolscap-based server implemented in src/allmydata/storage/*.py .
|
|||||||
from past.builtins import unicode
|
from past.builtins import unicode
|
||||||
|
|
||||||
import re, time, hashlib
|
import re, time, hashlib
|
||||||
try:
|
|
||||||
from ConfigParser import (
|
# On Python 2 this will be the backport.
|
||||||
NoSectionError,
|
from configparser import NoSectionError
|
||||||
)
|
|
||||||
except ImportError:
|
|
||||||
from configparser import NoSectionError
|
|
||||||
import attr
|
import attr
|
||||||
from zope.interface import (
|
from zope.interface import (
|
||||||
Attribute,
|
Attribute,
|
||||||
|
@ -16,13 +16,9 @@ if PY2:
|
|||||||
# we do "r" or "w".
|
# 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
|
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:
|
# On Python 2 we use the backport package; that means we always get unicode
|
||||||
# In theory on Python 2 configparser also works, but then code gets the
|
# out.
|
||||||
# wrong exceptions and they don't get handled. So just use native parser
|
from configparser import SafeConfigParser
|
||||||
# for now.
|
|
||||||
from ConfigParser import SafeConfigParser
|
|
||||||
else:
|
|
||||||
from configparser import SafeConfigParser
|
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user