From 5377d8bf89dfbb472bdfdb32ebc05f2bd8050567 Mon Sep 17 00:00:00 2001 From: Lars Butler Date: Thu, 1 Feb 2018 11:41:56 +0100 Subject: [PATCH] Fix ConfigParser import for Python3 in setup_posix.py Otherwise, this module will raise ModuleNotFound errors on import. --- 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