From 1746daa62ea6cccef56a936748721d2232709d1e Mon Sep 17 00:00:00 2001 From: Jorge Moraleda Date: Thu, 20 Apr 2023 11:20:49 -0400 Subject: [PATCH 01/14] Update bundled wxWidgets to v3.2.2.1 --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index 01bda924..a812fffd 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 01bda9242fa88441f582593f086e4e9092315d13 +Subproject commit a812fffda3fe686c94e24bff27e8effd96e4de64 From 87b606aa041eba8274d6ca50da015f92070d74c6 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Fri, 21 Apr 2023 17:10:54 -0400 Subject: [PATCH 02/14] Remove deprecated setuptools options use_2to3 and license-file --- setup.cfg | 2 +- setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index cd9ba012..2fcd714f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,3 @@ [metadata] -license-file = LICENSE.txt +license_files = LICENSE.txt diff --git a/setup.py b/setup.py index 3c32ca77..a9bad375 100644 --- a/setup.py +++ b/setup.py @@ -374,7 +374,6 @@ if __name__ == '__main__': keywords = KEYWORDS, install_requires = INSTALL_REQUIRES, zip_safe = False, - use_2to3 = False, include_package_data = True, packages = WX_PKGLIST, From 3f81a62cce25c5d8df316c2d1994d0dbd14859e6 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Wed, 26 Apr 2023 10:32:05 -0400 Subject: [PATCH 03/14] Update sip to v6.7.9 --- requirements/devel.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/devel.txt b/requirements/devel.txt index bcfbbea3..5d6c4cc1 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -3,7 +3,7 @@ appdirs setuptools < 45 ; python_version < '3.0' setuptools ; python_version >= '3.0' -sip == 6.7.5 +sip == 6.7.9 wheel twine From 5d9f7aa185cd18da3e93ae1d0033fb9172d7a714 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 1 May 2023 13:53:55 -0400 Subject: [PATCH 04/14] agw: Fix TypeError caused by floats with Python 3.10 extensions. This fixes the following error: File "/lib/python3.10/site-packages/wx/lib/agw/pygauge.py", line 380, in OnPaint dc.DrawText(drawString, textXPos, textYPos) TypeError: DC.DrawText(): arguments did not match any overloaded call: overload 1: argument 2 has unexpected type 'float' overload 2: argument 2 has unexpected type 'float' TimeLeft: 3.0 Visible when using Python 3.10 or newer. --- wx/lib/agw/pygauge.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/lib/agw/pygauge.py b/wx/lib/agw/pygauge.py index b8654436..da42e6f6 100644 --- a/wx/lib/agw/pygauge.py +++ b/wx/lib/agw/pygauge.py @@ -367,12 +367,12 @@ class PyGauge(wx.Window): drawString = self._drawIndicatorText_formatString.format(drawValue) rect = self.GetClientRect() (textWidth, textHeight, descent, extraLeading) = dc.GetFullTextExtent(drawString) - textYPos = (rect.height-textHeight)/2 + textYPos = (rect.height-textHeight)//2 if textHeight > rect.height: textYPos = 0-descent+extraLeading - textXPos = (rect.width-textWidth)/2 + textXPos = (rect.width-textWidth)//2 if textWidth>rect.width: textXPos = 0 From 25b0e2139e8171f737fde6c09d42978601c98b98 Mon Sep 17 00:00:00 2001 From: mprosperi Date: Tue, 23 May 2023 21:31:14 +0200 Subject: [PATCH 05/14] fixes #2208 --- wx/lib/agw/aui/auibook.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wx/lib/agw/aui/auibook.py b/wx/lib/agw/aui/auibook.py index f635beec..e06ea9ca 100644 --- a/wx/lib/agw/aui/auibook.py +++ b/wx/lib/agw/aui/auibook.py @@ -4610,8 +4610,8 @@ class AuiNotebook(wx.Panel): # because there are two panes, always split them # equally split_size = self.GetClientSize() - split_size.x /= 2 - split_size.y /= 2 + split_size.x //= 2 + split_size.y //= 2 # create a new tab frame new_tabs = TabFrame(self) @@ -4638,22 +4638,22 @@ class AuiNotebook(wx.Panel): if direction == wx.LEFT: pane_info.Left() - mouse_pt = wx.Point(0, cli_size.y/2) + mouse_pt = wx.Point(0, cli_size.y//2) elif direction == wx.RIGHT: pane_info.Right() - mouse_pt = wx.Point(cli_size.x, cli_size.y/2) + mouse_pt = wx.Point(cli_size.x, cli_size.y//2) elif direction == wx.TOP: pane_info.Top() - mouse_pt = wx.Point(cli_size.x/2, 0) + mouse_pt = wx.Point(cli_size.x//2, 0) elif direction == wx.BOTTOM: pane_info.Bottom() - mouse_pt = wx.Point(cli_size.x/2, cli_size.y) + mouse_pt = wx.Point(cli_size.x//2, cli_size.y) self._mgr.AddPane(new_tabs, pane_info, mouse_pt) self._mgr.Update() From 6e36ffa377a832418630a45f1c9b0e6de8d45bcb Mon Sep 17 00:00:00 2001 From: mprosperi Date: Wed, 24 May 2023 22:00:38 +0200 Subject: [PATCH 06/14] fix TypeError in wx.lib.agw.flatnotebook for py3.10+ (included #2210) (#2395) * fix TypError in wx.lib.agw.flatnotebook for py3.10+ (included #2210) * replaced round() with int() --------- Co-authored-by: mprosperi --- wx/lib/agw/flatnotebook.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wx/lib/agw/flatnotebook.py b/wx/lib/agw/flatnotebook.py index 2659223b..df0b7415 100644 --- a/wx/lib/agw/flatnotebook.py +++ b/wx/lib/agw/flatnotebook.py @@ -2232,7 +2232,7 @@ class FNBRenderer(object): return # Get the text height - tabHeight = self.CalcTabHeight(pageContainer) + tabHeight = int(self.CalcTabHeight(pageContainer)) agwStyle = pc.GetParent().GetAGWWindowStyleFlag() # Calculate the number of rows required for drawing the tabs @@ -2366,8 +2366,8 @@ class FNBRenderer(object): # Update the tab position & size posy = (pc.HasAGWFlag(FNB_BOTTOM) and [0] or [VERTICAL_BORDER_PADDING])[0] - pc._pagesInfoVec[i].SetPosition(wx.Point(posx, posy)) - pc._pagesInfoVec[i].SetSize(wx.Size(tabWidth, tabHeight)) + pc._pagesInfoVec[i].SetPosition(wx.Point(int(posx), int(posy))) + pc._pagesInfoVec[i].SetSize(wx.Size(int(tabWidth), int(tabHeight))) self.DrawFocusRectangle(dc, pc, pc._pagesInfoVec[i]) posx += tabWidth @@ -2461,7 +2461,7 @@ class FNBRenderer(object): break; # Add a result to the returned vector - tabRect = wx.Rect(posx, VERTICAL_BORDER_PADDING, tabWidth , tabHeight) + tabRect = wx.Rect(int(posx), VERTICAL_BORDER_PADDING, int(tabWidth) , int(tabHeight)) vTabInfo.append(tabRect) # Advance posx @@ -2567,7 +2567,7 @@ class FNBRendererDefault(FNBRenderer): pc = pageContainer tabPoints = [wx.Point() for ii in range(7)] - tabPoints[0].x = posx + tabPoints[0].x = int(posx) tabPoints[0].y = (pc.HasAGWFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0] tabPoints[1].x = int(posx+(tabHeight-2)*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi)) @@ -2646,14 +2646,14 @@ class FNBRendererDefault(FNBRenderer): imageXOffset = textOffset - 16 - padding pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc, - posx + imageXOffset, imageYCoord, + int(posx + imageXOffset), int(imageYCoord), wx.IMAGELIST_DRAW_TRANSPARENT, True) pageTextColour = pc._pParent.GetPageTextColour(tabIdx) if pageTextColour is not None: dc.SetTextForeground(pageTextColour) - dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord) + dc.DrawText(pc.GetPageText(tabIdx), int(posx + textOffset), int(imageYCoord)) # draw 'x' on tab (if enabled) if pc.HasAGWFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection(): @@ -2777,7 +2777,7 @@ class FNBRendererFirefox2(FNBRenderer): # take a bitmap from the position of the 'x' button (the x on tab button) # this bitmap will be used later to delete old buttons tabCloseButtonYCoord = imageYCoord - x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16) + x_rect = wx.Rect(int(tabCloseButtonXCoord), int(tabCloseButtonYCoord), 16, 16) # Draw the tab self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus) From 1d2eb2e39d71404f266f72cb5e1f4adf9ebfc221 Mon Sep 17 00:00:00 2001 From: mprosperi Date: Wed, 31 May 2023 15:39:33 +0200 Subject: [PATCH 07/14] fix float->int compatibility for py3.10+ (also fixes #2349) --- wx/lib/ogl/basic.py | 16 ++++++++-------- wx/lib/ogl/diagram.py | 2 +- wx/lib/ogl/drawn.py | 18 +++++++++--------- wx/lib/ogl/oglmisc.py | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/wx/lib/ogl/basic.py b/wx/lib/ogl/basic.py index e7e17bc8..37341ab7 100644 --- a/wx/lib/ogl/basic.py +++ b/wx/lib/ogl/basic.py @@ -1377,11 +1377,11 @@ class Shape(ShapeEvtHandler): def OnDrawOutline(self, dc, x, y, w, h): """The draw outline handler.""" - points = [[x - w / 2.0, y - h / 2.0], - [x + w / 2.0, y - h / 2.0], - [x + w / 2.0, y + h / 2.0], - [x - w / 2.0, y + h / 2.0], - [x - w / 2.0, y - h / 2.0], + points = [[int(x - w / 2.0), int(y - h / 2.0)], + [int(x + w / 2.0), int(y - h / 2.0)], + [int(x + w / 2.0), int(y + h / 2.0)], + [int(x - w / 2.0), int(y + h / 2.0)], + [int(x - w / 2.0), int(y - h / 2.0)], ] dc.DrawLines(points) @@ -3174,7 +3174,7 @@ class PolygonShape(Shape): dc.SetPen(self._pen) if self._brush: dc.SetBrush(self._brush) - dc.DrawPolygon(self._points, self._xpos, self._ypos) + dc.DrawPolygon(self._points, int(self._xpos), int(self._ypos)) def OnDrawOutline(self, dc, x, y, w, h): """The draw outline handler.""" @@ -3185,8 +3185,8 @@ class PolygonShape(Shape): intPoints = [] for point in self._originalPoints: - intPoints.append(wx.Point(x_proportion * point[0], y_proportion * point[1])) - dc.DrawPolygon(intPoints, x, y) + intPoints.append(wx.Point(int(x_proportion * point[0]), int(y_proportion * point[1]))) + dc.DrawPolygon(intPoints, int(x), int(y)) # Make as many control points as there are vertices def MakeControlPoints(self): diff --git a/wx/lib/ogl/diagram.py b/wx/lib/ogl/diagram.py index be3865ad..d24b3c6b 100644 --- a/wx/lib/ogl/diagram.py +++ b/wx/lib/ogl/diagram.py @@ -116,7 +116,7 @@ class Diagram(object): dc.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT)) dc.SetBrush(wx.TRANSPARENT_BRUSH) - dc.DrawLines([[x1, y1], [x2, y1], [x2, y2], [x1, y2], [x1, y1]]) + dc.DrawLines([[int(x1), int(y1)], [int(x2), int(y1)], [int(x2), int(y2)], [int(x1), int(y2)], [int(x1), int(y1)]]) def RecentreAll(self, dc): """Recentre all the text that should be centred. diff --git a/wx/lib/ogl/drawn.py b/wx/lib/ogl/drawn.py index 17a2992c..2da0025b 100644 --- a/wx/lib/ogl/drawn.py +++ b/wx/lib/ogl/drawn.py @@ -165,21 +165,21 @@ class OpDraw(DrawOp): def Do(self, dc, xoffset, yoffset): if self._op == DRAWOP_DRAW_LINE: - dc.DrawLine(self._x1 + xoffset, self._y1 + yoffset, self._x2 + xoffset, self._y2 + yoffset) + dc.DrawLine(int(self._x1 + xoffset), int(self._y1 + yoffset), int(self._x2 + xoffset), int(self._y2 + yoffset)) elif self._op == DRAWOP_DRAW_RECT: - dc.DrawRectangle(self._x1 + xoffset, self._y1 + yoffset, self._x2, self._y2) + dc.DrawRectangle(int(self._x1 + xoffset), int(self._y1 + yoffset), int(self._x2), int(self._y2)) elif self._op == DRAWOP_DRAW_ROUNDED_RECT: - dc.DrawRoundedRectangle(self._x1 + xoffset, self._y1 + yoffset, self._x2, self._y2, self._radius) + dc.DrawRoundedRectangle(int(self._x1 + xoffset), int(self._y1 + yoffset), int(self._x2), int(self._y2), self._radius) elif self._op == DRAWOP_DRAW_ELLIPSE: - dc.DrawEllipse(self._x1 + xoffset, self._y1 + yoffset, self._x2, self._y2) + dc.DrawEllipse(int(self._x1 + xoffset), int(self._y1 + yoffset), int(self._x2), int(self._y2)) elif self._op == DRAWOP_DRAW_ARC: - dc.DrawArc(self._x2 + xoffset, self._y2 + yoffset, self._x3 + xoffset, self._y3 + yoffset, self._x1 + xoffset, self._y1 + yoffset) + dc.DrawArc(int(self._x2 + xoffset), int(self._y2 + yoffset), int(self._x3 + xoffset), int(self._y3 + yoffset), int(self._x1 + xoffset), int(self._y1 + yoffset)) elif self._op == DRAWOP_DRAW_ELLIPTIC_ARC: - dc.DrawEllipticArc(self._x1 + xoffset, self._y1 + yoffset, self._x2, self._y2, self._x3 * 360 / (2 * math.pi), self._y3 * 360 / (2 * math.pi)) + dc.DrawEllipticArc(int(self._x1 + xoffset), int(self._y1 + yoffset), int(self._x2), int(self._y2), self._x3 * 360 / (2 * math.pi), self._y3 * 360 / (2 * math.pi)) elif self._op == DRAWOP_DRAW_POINT: dc.DrawPoint(self._x1 + xoffset, self._y1 + yoffset) elif self._op == DRAWOP_DRAW_TEXT: - dc.DrawText(self._textString, self._x1 + xoffset, self._y1 + yoffset) + dc.DrawText(self._textString, int(self._x1 + xoffset), int(self._y1 + yoffset)) def Scale(self, scaleX, scaleY): self._x1 *= scaleX self._y1 *= scaleY @@ -267,9 +267,9 @@ class OpPolyDraw(DrawOp): def Do(self, dc, xoffset, yoffset): if self._op == DRAWOP_DRAW_POLYLINE: - dc.DrawLines(self._points, xoffset, yoffset) + dc.DrawLines(self._points, int(xoffset), int(yoffset)) elif self._op == DRAWOP_DRAW_POLYGON: - dc.DrawPolygon(self._points, xoffset, yoffset) + dc.DrawPolygon(self._points, int(xoffset), int(yoffset)) elif self._op == DRAWOP_DRAW_SPLINE: dc.DrawSpline(self._points) # no offsets in DrawSpline diff --git a/wx/lib/ogl/oglmisc.py b/wx/lib/ogl/oglmisc.py index 78263aba..a685a329 100644 --- a/wx/lib/ogl/oglmisc.py +++ b/wx/lib/ogl/oglmisc.py @@ -528,7 +528,7 @@ def GetArrowPoints(x1, y1, x2, y2, length, width): x3 = -length * i_bar + x2 y3 = -length * j_bar + y2 - return x2, y2, width * -j_bar + x3, width * i_bar + y3, -width * -j_bar + x3, -width * i_bar + y3 + return int(x2), int(y2), int(width * -j_bar + x3), int(width * i_bar + y3), int(-width * -j_bar + x3), int(-width * i_bar + y3) def DrawArcToEllipse(x1, y1, width1, height1, x2, y2, x3, y3): From dd2164acfc0f5438bb88edf7e612e2ce0b4c4ecf Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 May 2023 12:36:50 -0700 Subject: [PATCH 08/14] Add builders for Python 3.11 --- CHANGES.rst | 3 +++ buildbot/master.cfg | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index baa58442..9cc99961 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,6 +20,9 @@ New and improved in this release: * Added wrappers for wxGenericStaticBitmap. +* This release was built using the wxWidgets' v3.2.2.1 release tag. + +* Added Python 3.11 to the build system. diff --git a/buildbot/master.cfg b/buildbot/master.cfg index 8b90924b..56423c10 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -201,6 +201,7 @@ regularBuilders = [ #'build-osx-py36', 'build-osx-py38', 'build-osx-py39', 'build-osx-py310', + 'build-osx-py311', #'build-gtk2-py36', #'build-gtk2-py37', 'build-gtk2-py38', @@ -210,6 +211,7 @@ regularBuilders = [ #'build-osx-py36', 'build-gtk3-py38', 'build-gtk3-py39', 'build-gtk3-py310', + 'build-gtk3-py311', #'build-win32-py36', #'build-win32-py37', #'build-win32-py38', @@ -219,12 +221,14 @@ regularBuilders = [ #'build-osx-py36', 'build-win64-py38', 'build-win64-py39', 'build-win64-py310', + 'build-win64-py311', ] distBuilders = [ #'dist-osx-py36', #'dist-osx-py37', 'dist-osx-py38', 'dist-osx-py39', 'dist-osx-py310', + 'dist-osx-py311', #'dist-win32-py36', #'dist-win32-py37', #'dist-win32-py38', @@ -234,6 +238,7 @@ distBuilders = [ #'dist-osx-py36', 'dist-win64-py38', 'dist-win64-py39', 'dist-win64-py310', + 'dist-win64-py311', ] otherBuilders = [ 'dist-docs-py37', 'dist-src-py37', From b1c55639dfb73db3a11307c9de888540cec512df Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 May 2023 12:37:44 -0700 Subject: [PATCH 09/14] No numpy yet for Python 3.12 --- requirements/install.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/install.txt b/requirements/install.txt index f57574be..1ff7cac5 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -1,5 +1,5 @@ # Runtime dependencies needed when using wxPython Phoenix numpy < 1.17 ; python_version <= '2.7' -numpy ; python_version >= '3.0' +numpy ; python_version >= '3.0' and python_version < '3.12' pillow six From ae6f5596d71df20bc2aa22ad79a727bb855c9c97 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 May 2023 13:37:14 -0700 Subject: [PATCH 10/14] Reenable win32 builds --- buildbot/master.cfg | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/buildbot/master.cfg b/buildbot/master.cfg index 56423c10..e3bfb6fd 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -211,11 +211,12 @@ regularBuilders = [ #'build-osx-py36', 'build-gtk3-py38', 'build-gtk3-py39', 'build-gtk3-py310', - 'build-gtk3-py311', #'build-win32-py36', #'build-win32-py37', - #'build-win32-py38', - #'build-win32-py39', + 'build-win32-py38', + 'build-win32-py39', + 'build-win32-py310', + 'build-win32-py311', #'build-win64-py36', #'build-win64-py37', 'build-win64-py38', @@ -231,8 +232,10 @@ distBuilders = [ #'dist-osx-py36', 'dist-osx-py311', #'dist-win32-py36', #'dist-win32-py37', - #'dist-win32-py38', - #'dist-win32-py39', + 'dist-win32-py38', + 'dist-win32-py39', + 'dist-win32-py310', + 'dist-win32-py311', #'dist-win64-py36', 'dist-win64-py37', 'dist-win64-py38', From 29520a122a5a7c34cbd9951102562297a6b5afb5 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Fri, 19 May 2023 13:59:33 -0400 Subject: [PATCH 11/14] Replace use of deprecated PyUnicode APIs (cherry picked from commit 2631eecb601370819e83475f423c2540eab84215) --- src/arrays.sip | 2 +- src/string.sip | 2 +- src/wxpy_api.sip | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arrays.sip b/src/arrays.sip index 37dd09ef..5b521c38 100644 --- a/src/arrays.sip +++ b/src/arrays.sip @@ -59,7 +59,7 @@ } PyErr_Clear(); wxString string; - size_t len = PyUnicode_GET_SIZE(item); + size_t len = PyUnicode_GET_LENGTH(item); if (len) { wxPyUnicode_AsWideChar(item, wxStringBuffer(string, len), len); } diff --git a/src/string.sip b/src/string.sip index db19c4dd..2f39bb29 100644 --- a/src/string.sip +++ b/src/string.sip @@ -45,7 +45,7 @@ } } *sipCppPtr = new wxString(); - size_t len = PyUnicode_GET_SIZE(uni); + size_t len = PyUnicode_GET_LENGTH(uni); if (len) { wxPyUnicode_AsWideChar(uni, wxStringBuffer(**sipCppPtr, len), len); } diff --git a/src/wxpy_api.sip b/src/wxpy_api.sip index cb901a78..765dfa8a 100644 --- a/src/wxpy_api.sip +++ b/src/wxpy_api.sip @@ -54,7 +54,7 @@ static wxString i_Py2wxString(PyObject* source) } } wxString target; - size_t len = PyUnicode_GET_SIZE(uni); + size_t len = PyUnicode_GET_LENGTH(uni); if (len) { wxPyUnicode_AsWideChar(uni, wxStringBuffer(target, len), len); } @@ -84,7 +84,7 @@ static wxString i_Py2wxString(PyObject* source) // } // } // // TODO: Coerce non-unicode types to unicode here? (Classic does) -// size_t len = PyUnicode_GET_SIZE(uni); +// size_t len = PyUnicode_GET_LENGTH(uni); // if (len) { // wxPyUnicode_AsWideChar(uni, wxStringBuffer(str, len), len); // } From 7f35fb72ffdfa046b30e44e4115e8bde3f5aeeef Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Fri, 19 May 2023 14:01:15 -0400 Subject: [PATCH 12/14] Update Cython to 0.29.34 for Python 3.12 support (cherry picked from commit 757de9d23a40befc628ba0b34fca3a1b1cb2cae9) --- requirements/devel.txt | 2 +- wx/svg/_nanosvg.c | 95 ++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/requirements/devel.txt b/requirements/devel.txt index 5d6c4cc1..78af8ab8 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -9,7 +9,7 @@ wheel twine requests requests[security] -cython==0.29.32 +cython==0.29.34 pytest pytest-xdist pytest-forked diff --git a/wx/svg/_nanosvg.c b/wx/svg/_nanosvg.c index 0f6912e7..b91bfd0e 100644 --- a/wx/svg/_nanosvg.c +++ b/wx/svg/_nanosvg.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.34 */ /* BEGIN: Cython Metadata { @@ -42,8 +42,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_34" +#define CYTHON_HEX_VERSION 0x001D22F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -120,7 +120,7 @@ END: Cython Metadata */ #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -236,7 +236,7 @@ END: Cython Metadata */ #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -275,7 +275,7 @@ END: Cython Metadata */ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -585,11 +585,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -598,14 +598,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1588,18 +1588,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -3178,7 +3178,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_12SVGimageBase_4CreateFromFile(PyTy if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 148, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 148, __pyx_L1_error) /* "wx/svg/_nanosvg.pyx":147 * units_b = units.encode('utf-8') @@ -11701,7 +11701,7 @@ static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_unpickle___Pyx_EnumMeta__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12478,7 +12478,7 @@ static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED * return __pyx_result * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state): */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_4 = __pyx_unpickle___Pyx_EnumMeta__set_state(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -14487,7 +14487,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyString_Type_encode.type = (PyObject*)&PyString_Type; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -14861,7 +14861,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -15186,7 +15186,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_XGOTREF(__Pyx_globals); __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); @@ -15413,7 +15413,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_XGOTREF(__Pyx_globals); __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); @@ -15570,7 +15570,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_XGOTREF(__Pyx_globals); __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); @@ -15867,7 +15867,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_XGOTREF(__Pyx_globals); __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); @@ -16164,7 +16164,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_XGOTREF(__Pyx_globals); __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); @@ -16531,7 +16531,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_XGOTREF(__Pyx_globals); __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); @@ -17140,13 +17140,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -17154,6 +17148,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -17372,7 +17372,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -17612,11 +17612,11 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { - if (PY_VERSION_HEX >= 0x030700A0) { + #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - } else { + #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - } + #endif } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } @@ -18148,7 +18148,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { - PyObject *runerr; + PyObject *runerr = NULL; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { @@ -19221,9 +19221,14 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -19462,7 +19467,7 @@ bad: /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON From 35d78fb04def28cd438eda45d3e042d7fc4c0f76 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 May 2023 17:09:14 -0700 Subject: [PATCH 13/14] Add builders for 3.12 --- CHANGES.rst | 4 +++- buildbot/master.cfg | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 9cc99961..0ff8ca0c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,7 +10,7 @@ wxPython Changelog 4.2.1 ------------------- -* unreleased +* 1-June-2023 PyPI: https://pypi.python.org/pypi/wxPython/4.2.1 Extras: https://extras.wxPython.org/wxPython4/extras/ @@ -24,6 +24,8 @@ New and improved in this release: * Added Python 3.11 to the build system. +* Added Python 3.12 (beta) to the build system. + 4.2.0 "Rumors of my death are only slightly exaggerated" diff --git a/buildbot/master.cfg b/buildbot/master.cfg index e3bfb6fd..fd417ac6 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -217,12 +217,14 @@ regularBuilders = [ #'build-osx-py36', 'build-win32-py39', 'build-win32-py310', 'build-win32-py311', + 'build-win32-py312', #'build-win64-py36', #'build-win64-py37', 'build-win64-py38', 'build-win64-py39', 'build-win64-py310', 'build-win64-py311', + 'build-win64-py312', ] distBuilders = [ #'dist-osx-py36', #'dist-osx-py37', @@ -236,12 +238,14 @@ distBuilders = [ #'dist-osx-py36', 'dist-win32-py39', 'dist-win32-py310', 'dist-win32-py311', + 'dist-win32-py312', #'dist-win64-py36', 'dist-win64-py37', 'dist-win64-py38', 'dist-win64-py39', 'dist-win64-py310', 'dist-win64-py311', + 'dist-win64-py312', ] otherBuilders = [ 'dist-docs-py37', 'dist-src-py37', From a5480e537dc6486a52162cee471e6b2ed4881bad Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 May 2023 17:31:02 -0700 Subject: [PATCH 14/14] Py 3.12 syntax fix --- buildtools/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/config.py b/buildtools/config.py index 8072a2d2..cf9f2ba1 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -1033,7 +1033,7 @@ def canGetSOName(): def getSOName(filename): output = runcmd('objdump -p %s' % filename, True) - result = re.search('^\s+SONAME\s+(.+)$', output, re.MULTILINE) + result = re.search(r'^\s+SONAME\s+(.+)$', output, re.MULTILINE) if result: return result.group(1) return None