comparison mercurial/statprof.py @ 30268:ad4c0236168d

statprof: fix flake8 warnings My local flake8 hook informed me of these warnings in the upstream code. Fix them.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 14 Aug 2016 19:13:32 -0700
parents b032a7b676c6
children f42cd5434cc2
comparison
equal deleted inserted replaced
30267:b032a7b676c6 30268:ad4c0236168d
102 main thread's work patterns. 102 main thread's work patterns.
103 """ 103 """
104 # no-check-code 104 # no-check-code
105 from __future__ import division 105 from __future__ import division
106 106
107 import inspect, json, os, signal, tempfile, sys, getopt, threading, traceback 107 import inspect, json, os, signal, tempfile, sys, getopt, threading
108 import time 108 import time
109 from collections import defaultdict 109 from collections import defaultdict
110 from contextlib import contextmanager 110 from contextlib import contextmanager
111 from subprocess import call
112 111
113 __all__ = ['start', 'stop', 'reset', 'display', 'profile'] 112 __all__ = ['start', 'stop', 'reset', 'display', 'profile']
114 113
115 skips = set(["util.py:check", "extensions.py:closure", 114 skips = set(["util.py:check", "extensions.py:closure",
116 "color.py:colorcmd", "dispatch.py:checkargs", 115 "color.py:colorcmd", "dispatch.py:checkargs",
326 sites = ['\1'.join([s.path, str(s.lineno), s.function]) 325 sites = ['\1'.join([s.path, str(s.lineno), s.function])
327 for s in stack] 326 for s in stack]
328 file.write(time + '\0' + '\0'.join(sites) + '\n') 327 file.write(time + '\0' + '\0'.join(sites) + '\n')
329 328
330 file.close() 329 file.close()
331 except (IOError, OSError) as ex: 330 except (IOError, OSError):
332 # The home directory probably didn't exist, or wasn't writable. Oh well. 331 # The home directory probably didn't exist, or wasn't writable. Oh well.
333 pass 332 pass
334 333
335 def load_data(path=None): 334 def load_data(path=None):
336 path = path or (os.environ['HOME'] + '/statprof.data') 335 path = path or (os.environ['HOME'] + '/statprof.data')