From cbb565c9ab6dd662504022557f64559f69eae2a3 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Sun, 12 Jan 2025 21:10:46 +0100 Subject: [PATCH] ci --- Lib/configparser.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Lib/configparser.py b/Lib/configparser.py index fefde6e0d1a231..f1c428a86a694b 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -561,7 +561,7 @@ def __init__(self): self.errors = list() -class Line(object): +class _Line(object): def __init__(self, value, prefixes, matcher ): self.value = value @@ -585,7 +585,7 @@ def has_comments(self): return self.value.strip() != self.clean -class LineParser(): +class _LineParser(): __slots__ =['prefixes', 'matcher'] def __init__(self, prefixes): @@ -597,7 +597,7 @@ def __init__(self, prefixes): ) def parse(self, value): - return Line(value, self.prefixes, self.matcher) + return _Line(value, self.prefixes, self.matcher) class RawConfigParser(MutableMapping): """ConfigParser that does not do interpolation.""" @@ -1072,10 +1072,7 @@ def _read(self, fp, fpname): def _read_inner(self, fp, fpname): st = _ReadState() - line_parser = LineParser(self._prefixes) - - # Line = functools.partial(_Line, prefixes=self._prefixes, matcher=line_parser.matcher) - #for st.lineno, line in enumerate(map(Line, fp), start=1): + line_parser = _LineParser(self._prefixes) for st.lineno, line in enumerate(map(line_parser.parse, fp), start=1): if not line.clean: if self._empty_lines_in_values: