Mercurial > public > mercurial-scm > hg-stable
diff mercurial/pure/osutil.py @ 45957:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 346af7687c6f |
children | 52528570312e |
line wrap: on
line diff
--- a/mercurial/pure/osutil.py Fri Nov 27 17:00:00 2020 -0500 +++ b/mercurial/pure/osutil.py Fri Nov 27 17:03:29 2020 -0500 @@ -39,7 +39,7 @@ def listdir(path, stat=False, skip=None): - '''listdir(path, stat=False) -> list_of_tuples + """listdir(path, stat=False) -> list_of_tuples Return a sorted list containing information about the entries in the directory. @@ -51,7 +51,7 @@ Otherwise, each element is a 2-tuple: (name, type) - ''' + """ result = [] prefix = path if not prefix.endswith(pycompat.ossep): @@ -222,7 +222,7 @@ ) class posixfile(object): - '''a file object aiming for POSIX-like semantics + """a file object aiming for POSIX-like semantics CPython's open() returns a file that was opened *without* setting the _FILE_SHARE_DELETE flag, which causes rename and unlink to abort. @@ -231,7 +231,7 @@ renamed and deleted while they are held open. Note that if a file opened with posixfile is unlinked, the file remains but cannot be opened again or be recreated under the same name, - until all reading processes have closed the file.''' + until all reading processes have closed the file.""" def __init__(self, name, mode=b'r', bufsize=-1): if b'b' in mode: @@ -290,11 +290,11 @@ return getattr(self._file, name) def __setattr__(self, name, value): - '''mimics the read-only attributes of Python file objects + """mimics the read-only attributes of Python file objects by raising 'TypeError: readonly attribute' if someone tries: f = posixfile('foo.txt') f.name = 'bla' - ''' + """ return self._file.__setattr__(name, value) def __enter__(self):