Skip to content

Commit

Permalink
Fix distutils not found with Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
danyeaw committed Jan 20, 2024
1 parent c494f24 commit c815292
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions gvsbuild/patches/glib/python-312-distutils-to-packaging.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Subject: [PATCH] Replace distutils with packaging
---
Index: gio/gdbus-2.0/codegen/utils.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
--- a/gio/gdbus-2.0/codegen/utils.py (revision e93fd4cfc39167cf0ceb9c531238d9800d3d9edb)
+++ b/gio/gdbus-2.0/codegen/utils.py (date 1705782834785)
@@ -19,7 +19,7 @@
#
# Author: David Zeuthen <davidz@redhat.com>

-import distutils.version
+import packaging.version
import os
import sys

@@ -166,4 +166,4 @@
v = str(key[0])
else:
v = "0"
- return (distutils.version.LooseVersion(v), key[1])
+ return (packaging.version.Version(v), key[1])
1 change: 1 addition & 0 deletions gvsbuild/projects/glib.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self):
],
patches=[
"glib-package-installation-directory.patch",
"python-312-distutils-to-packaging.patch",
],
)

Expand Down

0 comments on commit c815292

Please sign in to comment.