@@ -446,12 +446,11 @@ def _read(self, fp: Union[BufferedReader, IO[bytes]], fpname: str) -> None:
446446 def string_decode (v : str ) -> str :
447447 if v [- 1 ] == "\\ " :
448448 v = v [:- 1 ]
449- # end cut trailing escapes to prevent decode error
449+ # END cut trailing escapes to prevent decode error
450450
451451 return v .encode (defenc ).decode ("unicode_escape" )
452- # end
453452
454- # end
453+ # END def string_decode
455454
456455 while True :
457456 # We assume to read binary!
@@ -496,12 +495,12 @@ def string_decode(v: str) -> str:
496495 optval = optval .strip ()
497496 if optval == '""' :
498497 optval = ""
499- # end handle empty string
498+ # END handle empty string
500499 optname = self .optionxform (optname .rstrip ())
501500 if len (optval ) > 1 and optval [0 ] == '"' and optval [- 1 ] != '"' :
502501 is_multi_line = True
503502 optval = string_decode (optval [1 :])
504- # end handle multi-line
503+ # END handle multi-line
505504 # Preserves multiple values for duplicate optnames.
506505 cursect .add (optname , optval )
507506 else :
@@ -516,7 +515,7 @@ def string_decode(v: str) -> str:
516515 if line .endswith ('"' ):
517516 is_multi_line = False
518517 line = line [:- 1 ]
519- # end handle quotations
518+ # END handle quotations
520519 optval = cursect .getlast (optname )
521520 cursect .setlast (optname , optval + string_decode (line ))
522521 # END parse section or option
@@ -600,7 +599,7 @@ def read(self) -> None: # type: ignore[override]
600599 files_to_read = [self ._file_or_files ]
601600 else : # for lists or tuples
602601 files_to_read = list (self ._file_or_files )
603- # end ensure we have a copy of the paths to handle
602+ # END ensure we have a copy of the paths to handle
604603
605604 seen = set (files_to_read )
606605 num_read_include_files = 0
@@ -631,27 +630,26 @@ def read(self) -> None: # type: ignore[override]
631630 if not osp .isabs (include_path ):
632631 if not file_ok :
633632 continue
634- # end ignore relative paths if we don't know the configuration file path
633+ # END ignore relative paths if we don't know the configuration file path
635634 file_path = cast (PathLike , file_path )
636635 assert osp .isabs (file_path ), "Need absolute paths to be sure our cycle checks will work"
637636 include_path = osp .join (osp .dirname (file_path ), include_path )
638- # end make include path absolute
637+ # END make include path absolute
639638 include_path = osp .normpath (include_path )
640639 if include_path in seen or not os .access (include_path , os .R_OK ):
641640 continue
642641 seen .add (include_path )
643642 # Insert included file to the top to be considered first.
644643 files_to_read .insert (0 , include_path )
645644 num_read_include_files += 1
646- # each include path in configuration file
647- # end handle includes
645+ # END each include path in configuration file
646+ # END handle includes
648647 # END for each file object to read
649648
650649 # If there was no file included, we can safely write back (potentially) the
651650 # configuration file without altering its meaning.
652651 if num_read_include_files == 0 :
653652 self ._merge_includes = False
654- # end
655653
656654 def _write (self , fp : IO ) -> None :
657655 """Write an .ini-format representation of the configuration state in
@@ -714,15 +712,15 @@ def write(self) -> None:
714712 "Cannot write back if there is not exactly a single file to write to, have %i files"
715713 % len (self ._file_or_files )
716714 )
717- # end assert multiple files
715+ # END assert multiple files
718716
719717 if self ._has_includes ():
720718 log .debug (
721719 "Skipping write-back of configuration file as include files were merged in."
722720 + "Set merge_includes=False to prevent this."
723721 )
724722 return None
725- # end
723+ # END stop if we have include files
726724
727725 fp = self ._file_or_files
728726
@@ -904,7 +902,7 @@ def rename_section(self, section: str, new_name: str) -> "GitConfigParser":
904902 new_section = self ._sections [new_name ]
905903 for k , vs in self .items_all (section ):
906904 new_section .setall (k , vs )
907- # end for each value to copy
905+ # END for each value to copy
908906
909907 # This call writes back the changes, which is why we don't have the respective decorator.
910908 self .remove_section (section )
0 commit comments