# HG changeset patch # User Gregory Szorc # Date 1646323473 28800 # Node ID a2c59b361e0f6dc4878fb04889e40d0cefd39acf # Parent 7f5e91cdebcd16f7b18ccf3ac2b9895b04509934 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 diff -r 7f5e91cdebcd -r a2c59b361e0f mercurial/posix.py --- 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):