void-packages/srcpkgs/wxPython4/patches/python-3.11.patch

85 lines
3.3 KiB
Diff

Index: wxPython-4.0.7/bin/.waf3/waflib/ConfigSet.py
===================================================================
--- wxPython-4.0.7.orig/bin/.waf3/waflib/ConfigSet.py
+++ wxPython-4.0.7/bin/.waf3/waflib/ConfigSet.py
@@ -146,7 +146,7 @@ class ConfigSet(object):
Utils.writef(filename,''.join(buf))
def load(self,filename):
tbl=self.table
- code=Utils.readf(filename,m='rU')
+ code=Utils.readf(filename,m='r')
for m in re_imp.finditer(code):
g=m.group
tbl[g(2)]=eval(g(3))
Index: wxPython-4.0.7/bin/.waf3/waflib/Context.py
===================================================================
--- wxPython-4.0.7.orig/bin/.waf3/waflib/Context.py
+++ wxPython-4.0.7/bin/.waf3/waflib/Context.py
@@ -106,7 +106,7 @@ class Context(ctx):
cache[node]=True
self.pre_recurse(node)
try:
- function_code=node.read('rU',encoding)
+ function_code=node.read('r',encoding)
exec(compile(function_code,node.abspath(),'exec'),self.exec_dict)
finally:
self.post_recurse(node)
@@ -346,7 +346,7 @@ def load_module(path,encoding=None):
pass
module=imp.new_module(WSCRIPT_FILE)
try:
- code=Utils.readf(path,m='rU',encoding=encoding)
+ code=Utils.readf(path,m='r',encoding=encoding)
except EnvironmentError:
raise Errors.WafError('Could not read the file %r'%path)
module_dir=os.path.dirname(path)
Index: wxPython-4.0.7/sip/siplib/sip.h
===================================================================
--- wxPython-4.0.7.orig/sip/siplib/sip.h
+++ wxPython-4.0.7/sip/siplib/sip.h
@@ -1794,7 +1794,7 @@ typedef struct _sipAPIDef {
int (*api_get_time)(PyObject *, sipTimeDef *);
PyObject *(*api_from_time)(const sipTimeDef *);
int (*api_is_user_type)(const sipWrapperType *);
- struct _frame *(*api_get_frame)(int);
+ PyFrameObject *(*api_get_frame)(int);
int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **);
void (*api_unicode_write)(int, void *, int, unsigned);
Index: wxPython-4.0.7/sip/siplib/siplib.c
===================================================================
--- wxPython-4.0.7.orig/sip/siplib/siplib.c
+++ wxPython-4.0.7/sip/siplib/siplib.c
@@ -439,7 +439,7 @@ static PyObject *sip_api_from_datetime(c
static int sip_api_get_time(PyObject *obj, sipTimeDef *time);
static PyObject *sip_api_from_time(const sipTimeDef *time);
static int sip_api_is_user_type(const sipWrapperType *wt);
-static struct _frame *sip_api_get_frame(int);
+static PyFrameObject *sip_api_get_frame(int);
static int sip_api_check_plugin_for_type(const sipTypeDef *td,
const char *name);
static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar,
@@ -13688,15 +13688,19 @@ static int sip_api_is_user_type(const si
/*
* Return a frame from the execution stack.
*/
-static struct _frame *sip_api_get_frame(int depth)
+static PyFrameObject *sip_api_get_frame(int depth)
{
- struct _frame *frame = PyEval_GetFrame();
+ PyFrameObject *frame = PyEval_GetFrame();
+ Py_XINCREF(frame);
while (frame != NULL && depth > 0)
{
- frame = frame->f_back;
+ PyFrameObject *oframe = frame;
+ frame = PyFrame_GetBack(frame);
+ Py_DECREF(oframe);
--depth;
}
+ Py_XDECREF(frame);
return frame;
}