Mercurial > hg
diff mercurial/posix.py @ 48885:a2c59b361e0f
posix: delete Python 2 posixfile()
The comment no longer makes sense since the stdlib open() behaves
the way we want on Python 3. So it was removed.
Differential Revision: https://phab.mercurial-scm.org/D12288
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 03 Mar 2022 08:04:33 -0800 |
parents | 6000f5b25c9b |
children | 642e31cb55f0 |
line wrap: on
line diff
--- a/mercurial/posix.py Mon Feb 21 10:21:18 2022 -0700 +++ b/mercurial/posix.py Thu Mar 03 08:04:33 2022 -0800 @@ -59,21 +59,7 @@ umask = os.umask(0) os.umask(umask) -if not pycompat.ispy3: - - def posixfile(name, mode='r', buffering=-1): - fp = open(name, mode=mode, buffering=buffering) - # The position when opening in append mode is implementation defined, so - # make it consistent by always seeking to the end. - if 'a' in mode: - fp.seek(0, os.SEEK_END) - return fp - - -else: - # The underlying file object seeks as required in Python 3: - # https://github.com/python/cpython/blob/v3.7.3/Modules/_io/fileio.c#L474 - posixfile = open +posixfile = open def split(p):