File waflib_python312.patch of Package aubio

Index: aubio-0.4.9/waflib/Context.py
===================================================================
--- aubio-0.4.9.orig/waflib/Context.py
+++ aubio-0.4.9/waflib/Context.py
@@ -2,9 +2,17 @@
 # encoding: utf-8
 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
 
-import os,re,imp,sys
+import os, re, sys
 from waflib import Utils,Errors,Logs
 import waflib.Node
+
+if sys.hexversion > 0x3040000:
+	import types
+	class imp(object):
+		new_module = lambda x: types.ModuleType(x)
+else:
+	import imp
+
 HEXVERSION=0x2000e00
 WAFVERSION="2.0.14"
 WAFREVISION="907519cab9c1c8c7e4f7d4e468ed6200b9250d58"
Index: aubio-0.4.9/waflib/Tools/python.py
===================================================================
--- aubio-0.4.9.orig/waflib/Tools/python.py
+++ aubio-0.4.9/waflib/Tools/python.py
@@ -399,7 +399,7 @@ def configure(conf):
 	v.PYC=getattr(Options.options,'pyc',1)
 	v.PYO=getattr(Options.options,'pyo',1)
 	try:
-		v.PYTAG=conf.cmd_and_log(conf.env.PYTHON+['-c',"import imp;print(imp.get_tag())"]).strip()
+		v.PYTAG = conf.cmd_and_log(conf.env.PYTHON + ['-c', "import sys\ntry:\n print(sys.implementation.cache_tag)\nexcept AttributeError:\n import imp\n print(imp.get_tag())\n"]).strip()
 	except Errors.WafError:
 		pass
 def options(opt):
openSUSE Build Service is sponsored by