comparison mercurial/statprof.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 c8e8e14a5ee9
children af402c6b90db
comparison
equal deleted inserted replaced
38163:b39958d6b81b 38164:aac4be30e250
110 import inspect 110 import inspect
111 import json 111 import json
112 import os 112 import os
113 import signal 113 import signal
114 import sys 114 import sys
115 import tempfile
116 import threading 115 import threading
117 import time 116 import time
118 117
119 from . import ( 118 from . import (
120 encoding, 119 encoding,
689 print("error: missing %s" % scriptpath, file=fp) 688 print("error: missing %s" % scriptpath, file=fp)
690 print("get it here: https://github.com/brendangregg/FlameGraph", 689 print("get it here: https://github.com/brendangregg/FlameGraph",
691 file=fp) 690 file=fp)
692 return 691 return
693 692
694 fd, path = tempfile.mkstemp() 693 fd, path = pycompat.mkstemp()
695 694
696 file = open(path, "w+") 695 file = open(path, "w+")
697 696
698 lines = {} 697 lines = {}
699 for sample in data.samples: 698 for sample in data.samples: