Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49afa38

Browse files
committed
configparser.py: changed PendingDeprecationWarnings to DeprecationWarnings, via http://mail.python.org/pipermail/python-dev/2010-November/105391.html
configparser:py: renamed _views to _proxies to be consistent with the SectionProxy name
1 parent b9d10d0 commit 49afa38

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/configparser.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def filename(self):
319319
warnings.warn(
320320
"This 'filename' attribute will be removed in future versions. "
321321
"Use 'source' instead.",
322-
PendingDeprecationWarning, stacklevel=2
322+
DeprecationWarning, stacklevel=2
323323
)
324324
return self.source
325325

@@ -329,7 +329,7 @@ def filename(self, value):
329329
warnings.warn(
330330
"The 'filename' attribute will be removed in future versions. "
331331
"Use 'source' instead.",
332-
PendingDeprecationWarning, stacklevel=2
332+
DeprecationWarning, stacklevel=2
333333
)
334334
self.source = value
335335

@@ -410,8 +410,8 @@ def __init__(self, defaults=None, dict_type=_default_dict,
410410
self._dict = dict_type
411411
self._sections = self._dict()
412412
self._defaults = self._dict()
413-
self._views = self._dict()
414-
self._views[DEFAULTSECT] = SectionProxy(self, DEFAULTSECT)
413+
self._proxies = self._dict()
414+
self._proxies[DEFAULTSECT] = SectionProxy(self, DEFAULTSECT)
415415
if defaults:
416416
for key, value in defaults.items():
417417
self._defaults[self.optionxform(key)] = value
@@ -457,7 +457,7 @@ def add_section(self, section):
457457
if section in self._sections:
458458
raise DuplicateSectionError(section)
459459
self._sections[section] = self._dict()
460-
self._views[section] = SectionProxy(self, section)
460+
self._proxies[section] = SectionProxy(self, section)
461461

462462
def has_section(self, section):
463463
"""Indicate whether the named section is present in the configuration.
@@ -553,7 +553,7 @@ def readfp(self, fp, filename=None):
553553
warnings.warn(
554554
"This method will be removed in future versions. "
555555
"Use 'parser.read_file()' instead.",
556-
PendingDeprecationWarning, stacklevel=2
556+
DeprecationWarning, stacklevel=2
557557
)
558558
self.read_file(fp, source=filename)
559559

@@ -702,13 +702,13 @@ def remove_section(self, section):
702702
existed = section in self._sections
703703
if existed:
704704
del self._sections[section]
705-
del self._views[section]
705+
del self._proxies[section]
706706
return existed
707707

708708
def __getitem__(self, key):
709709
if key != DEFAULTSECT and not self.has_section(key):
710710
raise KeyError(key)
711-
return self._views[key]
711+
return self._proxies[key]
712712

713713
def __setitem__(self, key, value):
714714
# To conform with the mapping protocol, overwrites existing values in
@@ -812,7 +812,7 @@ def _read(self, fp, fpname):
812812
cursect = self._dict()
813813
cursect['__name__'] = sectname
814814
self._sections[sectname] = cursect
815-
self._views[sectname] = SectionProxy(self, sectname)
815+
self._proxies[sectname] = SectionProxy(self, sectname)
816816
elements_added.add(sectname)
817817
# So sections can't start with a continuation line
818818
optname = None

0 commit comments

Comments
 (0)