Skip to content

Commit

Permalink
Use distutils from setuptools if not otherwise found
Browse files Browse the repository at this point in the history
  • Loading branch information
otsaloma committed Mar 30, 2024
1 parent 92db8f1 commit 4274a51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PENDING: Gaupol 1.14

* Change the icon for the toggle video player toolbar item to an action
icon (not mimetype) that has a symbolic version available
* Fix installation on Python >= 3.12 by using distutils from setuptools

2023-10-08: Gaupol 1.13
=======================
Expand Down
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,24 @@
extensions are not compiled either.
"""

import distutils
import glob
import logging
import os
import re
import shutil
import sys

from distutils import log
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)

try:
import distutils
except ImportError:
# Use distutils from setuptools, needed since Python 3.12.
# https://docs.python.org/3/whatsnew/3.12.html#distutils
import setuptools._distutils as distutils

from distutils.command.clean import clean
from distutils.command.install import install
from distutils.command.install_data import install_data
Expand Down

0 comments on commit 4274a51

Please sign in to comment.