Mercurial > hg
comparison mercurial/statprof.py @ 43088:0d612db7047c
py3: stop injecting pycompat.hasattr into modules
I only found a single user of this pattern, probably because we
use util.hasattr everywhere.
Differential Revision: https://phab.mercurial-scm.org/D7008
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 06 Oct 2019 16:39:13 -0400 |
parents | eef9a2d67051 |
children | 74802979dd9d |
comparison
equal
deleted
inserted
replaced
43087:66f2cc210a29 | 43088:0d612db7047c |
---|---|
166 # start_time when timer is active | 166 # start_time when timer is active |
167 self.last_start_time = None | 167 self.last_start_time = None |
168 # a float | 168 # a float |
169 if frequency: | 169 if frequency: |
170 self.sample_interval = 1.0 / frequency | 170 self.sample_interval = 1.0 / frequency |
171 elif not hasattr(self, 'sample_interval'): | 171 elif not pycompat.hasattr(self, 'sample_interval'): |
172 # default to 1000 Hz | 172 # default to 1000 Hz |
173 self.sample_interval = 1.0 / 1000.0 | 173 self.sample_interval = 1.0 / 1000.0 |
174 else: | 174 else: |
175 # leave the frequency as it was | 175 # leave the frequency as it was |
176 pass | 176 pass |