From 67238099e9c3478ba591080c6e582985c62b83c0 Mon Sep 17 00:00:00 2001 From: Bryan Richter <bryan@haskell.foundation> Date: Sun, 19 Mar 2023 18:57:43 +0200 Subject: [PATCH] Use String.find appopriately For the love of god --- gitlab-bot/ghc_perf_import_service/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gitlab-bot/ghc_perf_import_service/__init__.py b/gitlab-bot/ghc_perf_import_service/__init__.py index 4f5f015..c5e47da 100644 --- a/gitlab-bot/ghc_perf_import_service/__init__.py +++ b/gitlab-bot/ghc_perf_import_service/__init__.py @@ -214,8 +214,8 @@ class GHCPerfWebhookServer(WebhookServer): # This may cause false negatives, but I think that's the lesser # of two evils. and not ( - trace.find(b'GHC.IO.FD.fdWrite: resource exhausted') - or trace.find(b'<stdout>: hFlush: resource exhausted') + trace.find(b'GHC.IO.FD.fdWrite: resource exhausted') >= 0 + or trace.find(b'<stdout>: hFlush: resource exhausted') >= 0 )): joblog('exhausted disk') failures.append('no_space') @@ -276,11 +276,11 @@ class GHCPerfWebhookServer(WebhookServer): joblog('ulimit: Invalid argument') failures.append('ulimit') # #23039 - if trace.find(b'fresh repository.\x1b[0;m\nerror'): + if trace.find(b'fresh repository.\x1b[0;m\nerror') >= 0: joblog('error cloning fresh repository') failures.append('repo_clone') # #23039 again - if trace.find(b'refs/notes/perf:refs/notes/perf\nerror:'): + if trace.find(b'refs/notes/perf:refs/notes/perf\nerror:') >= 0: joblog('error fetch perf notes') failures.append('perf_note_fetch') ## ... others to be added... -- GitLab