changeset 48976: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 7f5e91cdebcd
children 127cc4535853
files mercurial/posix.py
diffstat 1 files changed, 1 insertions(+), 15 deletions(-) [+]
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):