From c62cfaf439b20697f389444747b58ab764854452 Mon Sep 17 00:00:00 2001
From: Itamar Turner-Trauring <itamar@pythonspeed.com>
Date: Tue, 20 Feb 2024 17:29:44 -0500
Subject: [PATCH 1/4] Less unnecessary runs.

---
 .github/workflows/test.yml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index e436ad3..5190b74 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,6 +1,10 @@
 name: Test
 
-on: [push, pull_request]
+on:
+  push:
+    branches: ["main"]
+  pull_request:
+    branches: ["main"]
 
 permissions:
   contents: read

From f66c0af652490a7eefe4ad0bb4e5bd5d386916bd Mon Sep 17 00:00:00 2001
From: Itamar Turner-Trauring <itamar@pythonspeed.com>
Date: Tue, 20 Feb 2024 17:31:42 -0500
Subject: [PATCH 2/4] Use sys.executable as executable name.

---
 src/profila/_gdb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/profila/_gdb.py b/src/profila/_gdb.py
index bd902e7..4278465 100644
--- a/src/profila/_gdb.py
+++ b/src/profila/_gdb.py
@@ -127,7 +127,7 @@ async def run_subprocess(
 
     process.stdin.write(b"-gdb-set mi-async\n")
     await _read_until_done(process)
-    process.stdin.write(b"-file-exec-file python\n")
+    process.stdin.write(f"-file-exec-file {quote(sys.executable)}\n".encode("utf-8"))
     await _read_until_done(process)
     process.stdin.write(
         b"-exec-arguments "

From aa8c9117a8965ed9d4ce7ed6248280183f3ccf04 Mon Sep 17 00:00:00 2001
From: Itamar Turner-Trauring <itamar@pythonspeed.com>
Date: Tue, 20 Feb 2024 17:35:25 -0500
Subject: [PATCH 3/4] Documentation of change.

---
 README.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/README.md b/README.md
index dcd3b2a..4354288 100644
--- a/README.md
+++ b/README.md
@@ -141,6 +141,13 @@ Instruction-level parallelism, branch mispredictions, SIMD, and the CPU memory c
 
 ## Changelog
 
+### v0.2.1
+
+Bug fixes:
+
+* Run Python using `sys.executable`, so it works in more environments.
+  Thanks to Jeremiah England for the bug report.
+
 ### v0.2.0
 
 Added support for Jupyter profiling.

From a2e8d9cb350829f2baa16683c6aca4b4ce188e06 Mon Sep 17 00:00:00 2001
From: Itamar Turner-Trauring <itamar@pythonspeed.com>
Date: Tue, 20 Feb 2024 17:37:02 -0500
Subject: [PATCH 4/4] Run tests on 3.12 too.

---
 .github/workflows/test.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 5190b74..a6db490 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,8 +14,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        # Numba doesn't do 3.12 yet
-        python-version: ["3.9", "3.10", "3.11"]
+        python-version: ["3.9", "3.10", "3.11", "3.12"]
     steps:
     - uses: actions/checkout@v4
     - name: Set up Python ${{ matrix.python-version }}