Mercurial > public > mercurial-scm > hg
diff hgext/gpg.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 | a8a902d7176e |
children | c303d65d2e34 |
line wrap: on
line diff
--- a/hgext/gpg.py Thu May 03 18:39:58 2018 +0900 +++ b/hgext/gpg.py Sat May 26 12:14:04 2018 +0900 @@ -9,7 +9,6 @@ import binascii import os -import tempfile from mercurial.i18n import _ from mercurial import ( @@ -61,11 +60,11 @@ sigfile = datafile = None try: # create temporary files - fd, sigfile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".sig") + fd, sigfile = pycompat.mkstemp(prefix="hg-gpg-", suffix=".sig") fp = os.fdopen(fd, r'wb') fp.write(sig) fp.close() - fd, datafile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".txt") + fd, datafile = pycompat.mkstemp(prefix="hg-gpg-", suffix=".txt") fp = os.fdopen(fd, r'wb') fp.write(data) fp.close()