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 ...@@ -33,10 +33,7 @@ import signal
import sqlite3 import sqlite3
import ssl import ssl
import string import string
try: from six.moves.urllib import parse as urlparse
import urlparse
except ImportError:
from urllib.parse import urlparse
import logging import logging
import logging.handlers import logging.handlers
......
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
from __future__ import print_function from __future__ import print_function
import argparse import argparse
try: from six.moves import http_client as httplib
import httplib
except ImportError:
from http import client as httplib
import requests import requests
import sys import sys
......
...@@ -17,16 +17,10 @@ ...@@ -17,16 +17,10 @@
# See COPYING file for full licensing terms. # See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
try: from six import StringIO
import StringIO
except ImportError:
from io import StringIO
import contextlib import contextlib
import datetime import datetime
try: from six.moves import http_client as httplib
import httplib
except ImportError:
from http import client as httplib
import ipaddress import ipaddress
import json import json
import mock import mock
...@@ -68,7 +62,7 @@ def findFreeTCPPort(ip=''): ...@@ -68,7 +62,7 @@ def findFreeTCPPort(ip=''):
@contextlib.contextmanager @contextlib.contextmanager
def captured_output(): 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 old_out, old_err = sys.stdout, sys.stderr
try: try:
sys.stdout, sys.stderr = new_out, new_err sys.stdout, sys.stderr = new_out, new_err
......
from __future__ import print_function from __future__ import print_function
try: from six.moves import http_client as httplib
import httplib
except ImportError:
from http import client as httplib
import json import json
import os import os
import requests import requests
......
...@@ -55,6 +55,7 @@ setup( ...@@ -55,6 +55,7 @@ setup(
'requests', # for getter and updater 'requests', # for getter and updater
'zc.lockfile', # for stateful updater 'zc.lockfile', # for stateful updater
'urllib3 >= 1.18', # https://github.com/urllib3/urllib3/issues/258 'urllib3 >= 1.18', # https://github.com/urllib3/urllib3/issues/258
'six', # for python 2 and 3 compatibility
'caucase', # provides utils for certificate management; 'caucase', # provides utils for certificate management;
# version requirement caucase >= 0.9.3 is dropped, as it # version requirement caucase >= 0.9.3 is dropped, as it
# is not working in some cases, but fortunately KeDiFa is # 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