Use python context manager to open file
This commit is contained in:
parent
c67661af61
commit
edacdc5e25
@ -177,7 +177,8 @@ def setup_profiling(args):
|
|||||||
exe = kitty_exe()
|
exe = kitty_exe()
|
||||||
cg = '/tmp/kitty-profile.callgrind'
|
cg = '/tmp/kitty-profile.callgrind'
|
||||||
print('Post processing profile data for', exe, '...')
|
print('Post processing profile data for', exe, '...')
|
||||||
subprocess.call(['pprof', '--callgrind', exe, '/tmp/kitty-profile.log'], stdout=open(cg, 'wb'))
|
with open(cg, 'wb') as f:
|
||||||
|
subprocess.call(['pprof', '--callgrind', exe, '/tmp/kitty-profile.log'], stdout=f)
|
||||||
try:
|
try:
|
||||||
subprocess.Popen(['kcachegrind', cg])
|
subprocess.Popen(['kcachegrind', cg])
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user