Mercurial > public > mercurial-scm > hg
comparison mercurial/vfs.py @ 52643:5cc8deb96b48
pyupgrade: modernize calls to superclass methods
This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of
`yield` statements commented out.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 05 Jan 2025 22:23:31 -0500 |
parents | 7346f93be7a4 |
children | 6ee3c401882b |
comparison
equal
deleted
inserted
replaced
52642:73ab542565e0 | 52643:5cc8deb96b48 |
---|---|
784 | 784 |
785 Do not instantiate outside the vfs layer. | 785 Do not instantiate outside the vfs layer. |
786 """ | 786 """ |
787 | 787 |
788 def __init__(self, fh, closer) -> None: | 788 def __init__(self, fh, closer) -> None: |
789 super(delayclosedfile, self).__init__(fh) | 789 super().__init__(fh) |
790 object.__setattr__(self, '_closer', closer) | 790 object.__setattr__(self, '_closer', closer) |
791 | 791 |
792 def __exit__(self, exc_type, exc_value, exc_tb) -> None: | 792 def __exit__(self, exc_type, exc_value, exc_tb) -> None: |
793 self._closer.close(self._origfh) | 793 self._closer.close(self._origfh) |
794 | 794 |
898 | 898 |
899 Do not instantiate outside the vfs layer. | 899 Do not instantiate outside the vfs layer. |
900 """ | 900 """ |
901 | 901 |
902 def __init__(self, fh) -> None: | 902 def __init__(self, fh) -> None: |
903 super(checkambigatclosing, self).__init__(fh) | 903 super().__init__(fh) |
904 object.__setattr__(self, '_oldstat', util.filestat.frompath(fh.name)) | 904 object.__setattr__(self, '_oldstat', util.filestat.frompath(fh.name)) |
905 | 905 |
906 def _checkambig(self) -> None: | 906 def _checkambig(self) -> None: |
907 oldstat = self._oldstat | 907 oldstat = self._oldstat |
908 if oldstat.stat: | 908 if oldstat.stat: |