-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add glib patch for Python 3.12 compatibility
Co-authored-by: Jeroen Ooms <jeroenooms@gmail.com>
- Loading branch information
1 parent
76054d4
commit f56f14a
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff -aurp glib-2.56.4.orig/py-compile glib-2.56.4/py-compile | ||
--- glib-2.56.4.orig/py-compile 2024-04-28 22:15:25 | ||
+++ glib-2.56.4/py-compile 2024-04-28 22:16:15 | ||
@@ -116,7 +116,7 @@ $PYTHON -c " | ||
fi | ||
|
||
$PYTHON -c " | ||
-import sys, os, py_compile, imp | ||
+import sys, os, py_compile | ||
|
||
files = '''$files''' | ||
|
||
@@ -129,15 +129,12 @@ for file in files.split(): | ||
continue | ||
sys.stdout.write(file) | ||
sys.stdout.flush() | ||
- if hasattr(imp, 'get_tag'): | ||
- py_compile.compile(filepath, imp.cache_from_source(filepath), path) | ||
- else: | ||
- py_compile.compile(filepath, filepath + 'c', path) | ||
+ py_compile.compile(filepath, filepath + 'c', path) | ||
sys.stdout.write('\n')" || exit $? | ||
|
||
# this will fail for python < 1.5, but that doesn't matter ... | ||
$PYTHON -O -c " | ||
-import sys, os, py_compile, imp | ||
+import sys, os, py_compile | ||
|
||
# pypy does not use .pyo optimization | ||
if hasattr(sys, 'pypy_translation_info'): | ||
@@ -153,10 +150,7 @@ for file in files.split(): | ||
continue | ||
sys.stdout.write(file) | ||
sys.stdout.flush() | ||
- if hasattr(imp, 'get_tag'): | ||
- py_compile.compile(filepath, imp.cache_from_source(filepath, False), path) | ||
- else: | ||
- py_compile.compile(filepath, filepath + 'o', path) | ||
+ py_compile.compile(filepath, filepath + 'o', path) | ||
sys.stdout.write('\n')" 2>/dev/null || : | ||
|
||
# Local Variables: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters