MCPcopy Index your code
hub / github.com/python/cpython / _handle_header

Method _handle_header

Lib/configparser.py:1126–1142  ·  view source on GitHub ↗
(self, st, sectname, fpname)

Source from the content-addressed store, hash-verified

1124 self._handle_header(st, mo.group('header'), fpname) if mo else self._handle_option(st, line, fpname)
1125
1126 def _handle_header(self, st, sectname, fpname):
1127 st.sectname = sectname
1128 if st.sectname in self._sections:
1129 if self._strict and st.sectname in st.elements_added:
1130 raise DuplicateSectionError(st.sectname, fpname,
1131 st.lineno)
1132 st.cursect = self._sections[st.sectname]
1133 st.elements_added.add(st.sectname)
1134 elif st.sectname == self.default_section:
1135 st.cursect = self._defaults
1136 else:
1137 st.cursect = self._dict()
1138 self._sections[st.sectname] = st.cursect
1139 self._proxies[st.sectname] = SectionProxy(self, st.sectname)
1140 st.elements_added.add(st.sectname)
1141 # So sections can't start with a continuation line
1142 st.optname = None
1143
1144 def _handle_option(self, st, line, fpname):
1145 # an option line?

Callers 1

_handle_restMethod · 0.95

Calls 3

SectionProxyClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected