Mercurial > hg
comparison mercurial/filemerge.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 | dea3903175ee |
children | 2ce60954b1b7 |
comparison
equal
deleted
inserted
replaced
38163:b39958d6b81b | 38164:aac4be30e250 |
---|---|
722 name = os.path.join(tmproot, pre) | 722 name = os.path.join(tmproot, pre) |
723 if ext: | 723 if ext: |
724 name += ext | 724 name += ext |
725 f = open(name, r"wb") | 725 f = open(name, r"wb") |
726 else: | 726 else: |
727 fd, name = tempfile.mkstemp(prefix=pre + '.', suffix=ext) | 727 fd, name = pycompat.mkstemp(prefix=pre + '.', suffix=ext) |
728 f = os.fdopen(fd, r"wb") | 728 f = os.fdopen(fd, r"wb") |
729 return f, name | 729 return f, name |
730 | 730 |
731 def tempfromcontext(prefix, ctx): | 731 def tempfromcontext(prefix, ctx): |
732 f, name = maketempfrompath(prefix, ctx.path()) | 732 f, name = maketempfrompath(prefix, ctx.path()) |