Commit 4c2db470 authored by Łukasz Nowak's avatar Łukasz Nowak

kedifa: Use six for py2/py3 compatibility

parent c9fc3b34
......@@ -33,10 +33,7 @@ import signal
import sqlite3
import ssl
import string
try:
import urlparse
except ImportError:
from urllib.parse import urlparse
from six.moves.urllib import parse as urlparse
import logging
import logging.handlers
......
......@@ -20,10 +20,7 @@
from __future__ import print_function
import argparse
try:
import httplib
except ImportError:
from http import client as httplib
from six.moves import http_client as httplib
import requests
import sys
......
......@@ -17,16 +17,10 @@
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
try:
import StringIO
except ImportError:
from io import StringIO
from six import StringIO
import contextlib
import datetime
try:
import httplib
except ImportError:
from http import client as httplib
from six.moves import http_client as httplib
import ipaddress
import json
import mock
......@@ -68,7 +62,7 @@ def findFreeTCPPort(ip=''):
@contextlib.contextmanager
def captured_output():
new_out, new_err = StringIO.StringIO(), StringIO.StringIO()
new_out, new_err = StringIO(), StringIO()
old_out, old_err = sys.stdout, sys.stderr
try:
sys.stdout, sys.stderr = new_out, new_err
......
from __future__ import print_function
try:
import httplib
except ImportError:
from http import client as httplib
from six.moves import http_client as httplib
import json
import os
import requests
......
......@@ -55,6 +55,7 @@ setup(
'requests', # for getter and updater
'zc.lockfile', # for stateful updater
'urllib3 >= 1.18', # https://github.com/urllib3/urllib3/issues/258
'six', # for python 2 and 3 compatibility
'caucase', # provides utils for certificate management;
# version requirement caucase >= 0.9.3 is dropped, as it
# is not working in some cases, but fortunately KeDiFa is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment