def _config_parser_constrained(self, read_only: bool) -> SectionConstraint:
        """:return: Config parser constrained to our submodule in read or write mode"""
        try:
            pc = self.parent_commit
        except ValueError:
            pc = None
        # END handle empty parent repository
        parser = self._config_parser(self.repo, pc, read_only)
        parser.set_submodule(self)
        return SectionConstraint(parser, sm_section(self.name))
:return: Config parser constrained to our submodule in read or write mode
git/objects/submodule/base.py