Mercurial > hg
comparison mercurial/posix.py @ 38164:aac4be30e250
py3: wrap tempfile.mkstemp() to use bytes path
This patch just flips the default to use a bytes path on Python 3.
ca1cf9b3cce7 is backed out as the bundlepath should be bytes now.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 26 May 2018 12:14:04 +0900 |
parents | 2d919ab6c5b4 |
children | cc9aa88792fe |
comparison
equal
deleted
inserted
replaced
38163:b39958d6b81b | 38164:aac4be30e250 |
---|---|
214 checkdir = cachedir | 214 checkdir = cachedir |
215 else: | 215 else: |
216 # check directly in path and don't leave checkisexec behind | 216 # check directly in path and don't leave checkisexec behind |
217 checkdir = path | 217 checkdir = path |
218 checkisexec = None | 218 checkisexec = None |
219 fh, fn = tempfile.mkstemp(dir=checkdir, prefix='hg-checkexec-') | 219 fh, fn = pycompat.mkstemp(dir=checkdir, prefix='hg-checkexec-') |
220 try: | 220 try: |
221 os.close(fh) | 221 os.close(fh) |
222 m = os.stat(fn).st_mode | 222 m = os.stat(fn).st_mode |
223 if m & EXECFLAGS == 0: | 223 if m & EXECFLAGS == 0: |
224 os.chmod(fn, m & 0o777 | EXECFLAGS) | 224 os.chmod(fn, m & 0o777 | EXECFLAGS) |