[PATCH 05 of 10 py3] posix: use open() instead of file()

Augie Fackler raf at durin42.com
Sun Mar 19 14:26:18 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1489899948 14400
#      Sun Mar 19 01:05:48 2017 -0400
# Node ID 5ac56851f3529c159555738967289b22fc3f622e
# Parent  b9ee2497bba6e49fb08e0119cef0f27baccb61f8
posix: use open() instead of file()

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -181,7 +181,7 @@ def checkexec(path):
                     except OSError as e:
                         if e.errno != errno.ENOENT:
                             raise
-                        file(checknoexec, 'w').close() # might fail
+                        open(checknoexec, 'w').close() # might fail
                         m = os.stat(checknoexec).st_mode
                     if m & EXECFLAGS == 0:
                         # check-exec is exec and check-no-exec is not exec


More information about the Mercurial-devel mailing list