From 41084c90fb3c8c2540d28aee233946e4088407be Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefano@rivera.za.net>
Date: Sat, 12 Nov 2022 18:07:29 +0200
Subject: [PATCH] Import setuptools before distutils

setuptools 60 uses its own bundled version of distutils, by default. It
injects this into sys.modules, at import time. So we need to make sure
that it is imported, before anything else imports distutils, to ensure
everything is using the same distutils version.

In this case, the Cython imports import distutils, so we need to
pre-empt that.

This change in setuptools is to prepare for Python 3.12, which will drop
distutils.

Fixes: https://bugs.debian.org/1022472
---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index dcd9962..6a16296 100644
--- a/setup.py
+++ b/setup.py
@@ -7,9 +7,9 @@ import shlex
 import subprocess
 import sys
 
+from setuptools import Extension, find_packages, setup
 from Cython.Build import cythonize
 from Cython.Compiler.AutoDocTransforms import EmbedSignature
-from setuptools import Extension, find_packages, setup
 
 
 FFMPEG_LIBRARIES = [
-- 
GitLab