From a84bcfc723bef4ed8482a098e278a1a43bf26c8d Mon Sep 17 00:00:00 2001 From: saurabhg47 Date: Tue, 25 Jun 2019 19:15:35 +0530 Subject: [PATCH] In python 3.x ConfigParser changed to configparser Added try except block to support python 2.x and python 3.x --- setup_posix.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup_posix.py b/setup_posix.py index cfcf33ca..e595d255 100644 --- a/setup_posix.py +++ b/setup_posix.py @@ -1,5 +1,10 @@ import os, sys -from ConfigParser import SafeConfigParser +try: + # Python 2.x + from ConfigParser import SafeConfigParser +except ImportError: + # Python 3.x + from configparser import ConfigParser as SafeConfigParser # This dequote() business is required for some older versions # of mysql_config