comparison mercurial/debugcommands.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 b17fa9041695
children cc9aa88792fe
comparison
equal deleted inserted replaced
38163:b39958d6b81b 38164:aac4be30e250
1140 Returns 0 on success. 1140 Returns 0 on success.
1141 ''' 1141 '''
1142 opts = pycompat.byteskwargs(opts) 1142 opts = pycompat.byteskwargs(opts)
1143 1143
1144 def writetemp(contents): 1144 def writetemp(contents):
1145 (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-") 1145 (fd, name) = pycompat.mkstemp(prefix="hg-debuginstall-")
1146 f = os.fdopen(fd, r"wb") 1146 f = os.fdopen(fd, r"wb")
1147 f.write(contents) 1147 f.write(contents)
1148 f.close() 1148 f.close()
1149 return name 1149 return name
1150 1150