pw_compilation_testing: Fix to work with 3.8

Change-Id: I7b8c0f805370ec1c9b61155d2215552b119b2d39
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/110631
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_compilation_testing/py/pw_compilation_testing/runner.py b/pw_compilation_testing/py/pw_compilation_testing/runner.py
index 49577d2..7f902af 100644
--- a/pw_compilation_testing/py/pw_compilation_testing/runner.py
+++ b/pw_compilation_testing/py/pw_compilation_testing/runner.py
@@ -43,8 +43,10 @@
         for line in fd:
             if found_rule:
                 if line.startswith(cmd_prefix):
-                    return line[len(cmd_prefix):].strip().removeprefix(
-                        'ccache ')
+                    cmd = line[len(cmd_prefix):].strip()
+                    if cmd.startswith('ccache '):
+                        cmd = cmd[len('ccache '):]
+                    return cmd
 
                 if not line.startswith('  '):
                     break