summaryrefslogtreecommitdiffstats
path: root/test/__init__.py
diff options
context:
space:
mode:
authorAdam Cecile <adam.cecile@hitec.lu>2018-04-19 22:11:55 +0200
committerPrashanth Pai <ppai@redhat.com>2018-06-12 11:29:09 +0530
commitd5e4a0362a08ca3c0e7a33ea8caafccb22b906b2 (patch)
tree3670768441bf11b74139084322a10f97e355a4c5 /test/__init__.py
parent7bf9472939a41ac92514d9bfec55f45a53cfba6b (diff)
Port to Python 3.x
Based on PR sent by Adam C├ęcile (eLvErDe on GitHub): https://github.com/gluster/libgfapi-python/pull/21 Additional changes to original PR: * Make it pep8 compliant * Fix comment in getcwd() * Add functest36 env to tox.ini Change-Id: I45c4056333c12a82814cf8adcfa87e6687365366 Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'test/__init__.py')
-rw-r--r--test/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/__init__.py b/test/__init__.py
index b00eb23..4186ad0 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -9,7 +9,10 @@
# cases as published by the Free Software Foundation.
import os
-import ConfigParser
+try:
+ from configparser import ConfigParser
+except ImportError:
+ from ConfigParser import ConfigParser
def get_test_config():
@@ -22,7 +25,7 @@ def get_test_config():
dirname = os.path.dirname(__file__)
conf_file = dirname + "/test.conf"
if os.path.exists(conf_file):
- config = ConfigParser.ConfigParser()
+ config = ConfigParser()
config.read(conf_file)
return config
return None