summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-14 22:44:22 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-14 22:44:22 (GMT)
commite2514c6f1089ab1cdfba6ddc1dbaed1d37dd2be8 (patch)
tree1f0356149ed33a4bcca694f4f16b6f55c42126a6 /Lib
parent0a11f96f673dc6f3a7d43d58c249e1d183b1891c (diff)
downloadcpython-e2514c6f1089ab1cdfba6ddc1dbaed1d37dd2be8.zip
cpython-e2514c6f1089ab1cdfba6ddc1dbaed1d37dd2be8.tar.gz
cpython-e2514c6f1089ab1cdfba6ddc1dbaed1d37dd2be8.tar.bz2
Updated import statements to use the new `configparser` module name.
Updated the documentation to use the new name. Revert addition of the stub entry for the old name. Georg, I am reverting your changes since this commit should propagate to py3k.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/command/upload.py2
-rw-r--r--Lib/distutils/config.py2
-rw-r--r--Lib/distutils/dist.py2
-rw-r--r--Lib/idlelib/configHandler.py2
-rw-r--r--Lib/logging/config.py4
-rw-r--r--Lib/test/test___all__.py2
-rw-r--r--Lib/test/test_cfgparser.py36
7 files changed, 25 insertions, 25 deletions
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index daf6811..ecc06f0 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -10,7 +10,7 @@ from hashlib import md5
import os
import socket
import platform
-import ConfigParser
+import configparser
import httplib
import base64
import urlparse
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py
index cf54769..e9ba402 100644
--- a/Lib/distutils/config.py
+++ b/Lib/distutils/config.py
@@ -5,7 +5,7 @@ that uses .pypirc in the distutils.command package.
"""
import os
import sys
-from ConfigParser import ConfigParser
+from configparser import ConfigParser
from distutils.core import Command
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
index 0b13c1e..e4ab336 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -359,7 +359,7 @@ Common commands: (see '--help-commands' for more)
def parse_config_files (self, filenames=None):
- from ConfigParser import ConfigParser
+ from configparser import ConfigParser
if filenames is None:
filenames = self.find_config_files()
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index 3fc2a60..bdce85d 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -21,7 +21,7 @@ import os
import sys
import string
import macosxSupport
-from ConfigParser import ConfigParser, NoOptionError, NoSectionError
+from configparser import ConfigParser, NoOptionError, NoSectionError
class InvalidConfigType(Exception): pass
class InvalidConfigSet(Exception): pass
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 33d6f2f..b4c52b4 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -65,9 +65,9 @@ def fileConfig(fname, defaults=None):
rather than a filename, in which case the file-like object will be read
using readfp.
"""
- import ConfigParser
+ import configparser
- cp = ConfigParser.ConfigParser(defaults)
+ cp = configparser.ConfigParser(defaults)
if hasattr(cp, 'readfp') and hasattr(fname, 'readline'):
cp.readfp(fname)
else:
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 8d3e9ee..63df10a 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -37,7 +37,7 @@ class AllTest(unittest.TestCase):
self.check_all("BaseHTTPServer")
self.check_all("Bastion")
self.check_all("CGIHTTPServer")
- self.check_all("ConfigParser")
+ self.check_all("configparser")
self.check_all("Cookie")
self.check_all("MimeWriter")
self.check_all("Queue")
diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py
index a8b5d7c..4dfa795 100644
--- a/Lib/test/test_cfgparser.py
+++ b/Lib/test/test_cfgparser.py
@@ -1,4 +1,4 @@
-import ConfigParser
+import configparser
import StringIO
import unittest
import UserDict
@@ -94,7 +94,7 @@ class TestCaseBase(unittest.TestCase):
"remove_option() failed to report non-existance of option"
" that was removed")
- self.assertRaises(ConfigParser.NoSectionError,
+ self.assertRaises(configparser.NoSectionError,
cf.remove_option, 'No Such Section', 'foo')
eq(cf.get('Long Line', 'foo'),
@@ -147,17 +147,17 @@ class TestCaseBase(unittest.TestCase):
def test_parse_errors(self):
self.newconfig()
- self.parse_error(ConfigParser.ParsingError,
+ self.parse_error(configparser.ParsingError,
"[Foo]\n extra-spaces: splat\n")
- self.parse_error(ConfigParser.ParsingError,
+ self.parse_error(configparser.ParsingError,
"[Foo]\n extra-spaces= splat\n")
- self.parse_error(ConfigParser.ParsingError,
+ self.parse_error(configparser.ParsingError,
"[Foo]\noption-without-value\n")
- self.parse_error(ConfigParser.ParsingError,
+ self.parse_error(configparser.ParsingError,
"[Foo]\n:value-without-option-name\n")
- self.parse_error(ConfigParser.ParsingError,
+ self.parse_error(configparser.ParsingError,
"[Foo]\n=value-without-option-name\n")
- self.parse_error(ConfigParser.MissingSectionHeaderError,
+ self.parse_error(configparser.MissingSectionHeaderError,
"No Section!\n")
def parse_error(self, exc, src):
@@ -170,13 +170,13 @@ class TestCaseBase(unittest.TestCase):
"new ConfigParser should have no defined sections")
self.failIf(cf.has_section("Foo"),
"new ConfigParser should have no acknowledged sections")
- self.assertRaises(ConfigParser.NoSectionError,
+ self.assertRaises(configparser.NoSectionError,
cf.options, "Foo")
- self.assertRaises(ConfigParser.NoSectionError,
+ self.assertRaises(configparser.NoSectionError,
cf.set, "foo", "bar", "value")
- self.get_error(ConfigParser.NoSectionError, "foo", "bar")
+ self.get_error(configparser.NoSectionError, "foo", "bar")
cf.add_section("foo")
- self.get_error(ConfigParser.NoOptionError, "foo", "bar")
+ self.get_error(configparser.NoOptionError, "foo", "bar")
def get_error(self, exc, section, option):
try:
@@ -215,7 +215,7 @@ class TestCaseBase(unittest.TestCase):
def test_weird_errors(self):
cf = self.newconfig()
cf.add_section("Foo")
- self.assertRaises(ConfigParser.DuplicateSectionError,
+ self.assertRaises(configparser.DuplicateSectionError,
cf.add_section, "Foo")
def test_write(self):
@@ -324,7 +324,7 @@ class TestCaseBase(unittest.TestCase):
class ConfigParserTestCase(TestCaseBase):
- config_class = ConfigParser.ConfigParser
+ config_class = configparser.ConfigParser
def test_interpolation(self):
cf = self.get_interpolation_config()
@@ -335,11 +335,11 @@ class ConfigParserTestCase(TestCaseBase):
"something with lots of interpolation (9 steps)")
eq(cf.get("Foo", "bar10"),
"something with lots of interpolation (10 steps)")
- self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11")
+ self.get_error(configparser.InterpolationDepthError, "Foo", "bar11")
def test_interpolation_missing_value(self):
cf = self.get_interpolation_config()
- e = self.get_error(ConfigParser.InterpolationError,
+ e = self.get_error(configparser.InterpolationError,
"Interpolation Error", "name")
self.assertEqual(e.reference, "reference")
self.assertEqual(e.section, "Interpolation Error")
@@ -375,7 +375,7 @@ class ConfigParserTestCase(TestCaseBase):
class RawConfigParserTestCase(TestCaseBase):
- config_class = ConfigParser.RawConfigParser
+ config_class = configparser.RawConfigParser
def test_interpolation(self):
cf = self.get_interpolation_config()
@@ -410,7 +410,7 @@ class RawConfigParserTestCase(TestCaseBase):
class SafeConfigParserTestCase(ConfigParserTestCase):
- config_class = ConfigParser.SafeConfigParser
+ config_class = configparser.SafeConfigParser
def test_safe_interpolation(self):
# See http://www.python.org/sf/511737