summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-08-24 17:32:30 -0700
committerZac Medico <zmedico@gentoo.org>2011-08-24 17:32:30 -0700
commit4a4912dfcec973fc849d7e1326fb3309b5142228 (patch)
tree051185fae9bca9373ccf516ea0c213ae2617362c
parenta3c1e7f0c05f7be8507453324e178d041cb88796 (diff)
downloadportage-4a4912dfcec973fc849d7e1326fb3309b5142228.tar.gz
portage-4a4912dfcec973fc849d7e1326fb3309b5142228.tar.bz2
portage-4a4912dfcec973fc849d7e1326fb3309b5142228.zip
SafeConfigParser: renamed to ConfigParser in 3.2
-rw-r--r--pym/portage/_sets/__init__.py9
-rw-r--r--pym/portage/repository/config.py7
2 files changed, 13 insertions, 3 deletions
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index 1b3484ec1..34ca74b5d 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2007 Gentoo Foundation
+# Copyright 2007-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -6,8 +6,13 @@ from __future__ import print_function
__all__ = ["SETPREFIX", "get_boolean", "SetConfigError",
"SetConfig", "load_default_config"]
+import sys
try:
- from configparser import SafeConfigParser, NoOptionError
+ from configparser import NoOptionError
+ if sys.hexversion >= 0x3020000:
+ from configparser import ConfigParser as SafeConfigParser
+ else:
+ from configparser import SafeConfigParser
except ImportError:
from ConfigParser import SafeConfigParser, NoOptionError
from portage import os
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 9f0bb99cd..ac9793e4a 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -3,10 +3,15 @@
import io
import logging
+import sys
import re
try:
- from configparser import SafeConfigParser, ParsingError
+ from configparser import ParsingError
+ if sys.hexversion >= 0x3020000:
+ from configparser import ConfigParser as SafeConfigParser
+ else:
+ from configparser import SafeConfigParser
except ImportError:
from ConfigParser import SafeConfigParser, ParsingError
from portage import os