Skip to content

Commit

Permalink
Fixed pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisspen committed Jun 26, 2024
1 parent f053720 commit 97cb11b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions chroniker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ class TimedProcess(Process):
def __init__(self, max_seconds, time_type=c.MAX_TIME, fout=None, check_freq=1, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fout = fout or sys.stdout
try:
self.t0 = time.process_time()
except AttributeError:
self.t0 = time.clock()
self.t0 = time.process_time()
self.t0_objective = time.time()
self.max_seconds = float(max_seconds)
self.t1 = None
Expand Down Expand Up @@ -335,10 +332,7 @@ def get_duration_seconds_cpu(self):
if self.t1 is not None:
return self.t1 - self.t0

try:
now = time.process_time()
except AttributeError:
now = time.clock()
now = time.process_time()

return now - self.t0

Expand Down Expand Up @@ -451,10 +445,7 @@ def start_then_kill(self, verbose=True):
print('\nAttempting to terminate expired process %s...' % (self.pid,), file=self.fout)
timeout = True
self.terminate()
try:
self.t0 = time.process_time()
except AttributeError:
self.t0 = time.clock()
self.t0 = time.process_time()
self.t1_objective = time.time()
return timeout

Expand Down

0 comments on commit 97cb11b

Please sign in to comment.