From d2fdd92b8b91ef49fda4b568706913886babe116 Mon Sep 17 00:00:00 2001
From: Sajith Sasidharan <sajith@hcoop.net>
Date: Mon, 5 Jul 2021 08:37:49 -0400
Subject: [PATCH] Use older Tor on macOS + Python 2.7

---
 .github/workflows/ci.yml | 15 +++++++++++++--
 newsfragments/3744.minor |  0
 2 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 newsfragments/3744.minor

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d5b5f581d..b1c1108f7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -189,9 +189,20 @@ jobs:
         if: matrix.os == 'ubuntu-latest'
         run: sudo apt install tor
 
-      - name: Install Tor [macOS]
-        if: matrix.os == 'macos-latest'
+      - name: Install Tor [macOS, ${{ matrix.python-version }} ]
+        if: ${{ ( matrix.os == 'macos-latest' ) &&  ( matrix.python-version != '2.7' ) }}
         run: brew install tor
+        
+      # TODO: See https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3744.
+      # We have to use an older version of Tor for running integration
+      # tests on macOS using Python 2.7.  We should stop doing this
+      # when Python 2.7 is dropped.
+      - name: Install Tor [macOS, ${{ matrix.python-version }} ]
+        if: ${{ ( matrix.os == 'macos-latest' ) &&  ( matrix.python-version == '2.7' ) }}
+        run: |
+          brew extract --version 0.4.5.8 tor homebrew/cask
+          brew install tor@0.4.5.8
+          brew link --overwrite tor@0.4.5.8
 
       - name: Install Tor [Windows]
         if: matrix.os == 'windows-latest'
diff --git a/newsfragments/3744.minor b/newsfragments/3744.minor
new file mode 100644
index 000000000..e69de29bb