From a8ab269ada0c9376e2eb3fe03662c86e60ec96fb Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Sun, 5 Feb 2012 11:38:07 +0100 Subject: [PATCH] Import configparser for python3 compatability Attempt to load first ConfigParser and then configparser. At some point this should be switched to do the python3 thing first. Signed-off-by: Sebastian Spaeth --- offlineimap/CustomConfig.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/offlineimap/CustomConfig.py b/offlineimap/CustomConfig.py index e00b59d..b5869e7 100644 --- a/offlineimap/CustomConfig.py +++ b/offlineimap/CustomConfig.py @@ -1,5 +1,4 @@ -# Copyright (C) 2003 John Goerzen -# +# Copyright (C) 2003-2012 John Goerzen & contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +14,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -from ConfigParser import SafeConfigParser +try: + from ConfigParser import SafeConfigParser +except ImportError: #python3 + from configparser import SafeConfigParser from offlineimap.localeval import LocalEval import os