Skip to content

Commit 72a0f8d

Browse files
committed
Adjust test, style, and NEWS wrapping
1 parent 0c73259 commit 72a0f8d

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/configparser.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,8 @@ def _interpolate_some(self, parser, option, accum, rest, section, map,
471471
except KeyError:
472472
raise InterpolationMissingOptionError(
473473
option, section, rawval, var) from None
474-
475474
if v is None:
476475
continue
477-
478476
if "%" in v:
479477
self._interpolate_some(parser, option, accum, v,
480478
section, map, depth + 1)

Lib/test/test_configparser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,10 +1385,10 @@ def test_interpolation_with_allow_no_value(self):
13851385
cf.read_string(textwrap.dedent("""
13861386
[s]
13871387
a
1388-
b = x%(a)sy
1388+
b = %(a)s
13891389
"""))
13901390
self.assertIsNone(cf["s"]["a"])
1391-
self.assertEqual(cf.get("s", "b"), "xy")
1391+
self.assertEqual(cf.get("s", "b"), "")
13921392

13931393

13941394
class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass, unittest.TestCase):
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
Fix :class:`configparser.BasicInterpolation` raising ``TypeError`` when interpolating a reference to a value-less option with ``allow_no_value=True``; it now treats the missing value as empty, like :class:`configparser.ExtendedInterpolation`.
1+
Fix :class:`configparser.BasicInterpolation` raising ``TypeError`` when
2+
interpolating a reference to a value-less option with
3+
``allow_no_value=True``; it now treats the missing value as empty, like
4+
:class:`configparser.ExtendedInterpolation`.

0 commit comments

Comments
 (0)