Skip to content

Commit bad1c6c

Browse files
committed
stderr is always string, so we can remove None check
1 parent 5fea817 commit bad1c6c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

metric_providers/powermetrics/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def read_metrics(self, run_id, containers=None):
181181
def get_stderr(self):
182182
stderr = super().get_stderr()
183183

184-
if stderr is not None and stderr.find('proc_pid') != -1:
184+
if stderr.find('proc_pid') != -1:
185185
return None
186186

187187
return stderr

runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ def start_metric_providers(self, allow_container=True, allow_other=True):
962962

963963
stderr_read = metric_provider.get_stderr()
964964
print(f"Stderr check on {metric_provider.__class__.__name__}")
965-
if stderr_read is not None and stderr_read != '':
965+
if stderr_read:
966966
raise RuntimeError(f"Stderr on {metric_provider.__class__.__name__} was NOT empty: {stderr_read}")
967967

968968

@@ -1096,7 +1096,7 @@ def stop_metric_providers(self):
10961096
continue
10971097

10981098
stderr_read = metric_provider.get_stderr()
1099-
if stderr_read is not None and stderr_read != '':
1099+
if stderr_read:
11001100
errors.append(f"Stderr on {metric_provider.__class__.__name__} was NOT empty: {stderr_read}")
11011101

11021102
metric_provider.stop_profiling()

0 commit comments

Comments
 (0)