Mercurial > public > mercurial-scm > hg-stable
diff mercurial/pycompat.py @ 38198:2ce60954b1b7
py3: wrap tempfile.mkdtemp() to use bytes path
This also flips the default to use a bytes path on Python 3.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 26 May 2018 12:20:36 +0900 |
parents | aac4be30e250 |
children | cc9aa88792fe |
line wrap: on
line diff
--- a/mercurial/pycompat.py Sat May 26 12:14:04 2018 +0900 +++ b/mercurial/pycompat.py Sat May 26 12:20:36 2018 +0900 @@ -386,6 +386,9 @@ def gnugetoptb(args, shortlist, namelist): return _getoptbwrapper(getopt.gnu_getopt, args, shortlist, namelist) +def mkdtemp(suffix=b'', prefix=b'tmp', dir=None): + return tempfile.mkdtemp(suffix, prefix, dir) + # text=True is not supported; use util.from/tonativeeol() instead def mkstemp(suffix=b'', prefix=b'tmp', dir=None): return tempfile.mkstemp(suffix, prefix, dir)