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

login
register
mail settings
Submitter Augie Fackler
Date March 19, 2017, 6:26 p.m.
Message ID <5ac56851f3529c159555.1489947978@imladris.local>
Download mbox | patch
Permalink /patch/19454/
State Accepted
Headers show

Comments

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

Patch

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