From 815a5eae5e890e20be0ce6467078760dfbbed50e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 16 Jun 2020 20:43:20 -0700 Subject: [PATCH 1/9] update siplib source --- sip/siplib/sip.h | 6 +++--- sip/siplib/siplib.c | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/sip/siplib/sip.h b/sip/siplib/sip.h index bcb53ab2..5dc022ee 100644 --- a/sip/siplib/sip.h +++ b/sip/siplib/sip.h @@ -1,7 +1,7 @@ /* * The SIP module interface. * - * Copyright (c) 2018 Riverbank Computing Limited + * Copyright (c) 2020 Riverbank Computing Limited * * This file is part of SIP. * @@ -54,8 +54,8 @@ extern "C" { /* * Define the SIP version number. */ -#define SIP_VERSION 0x041313 -#define SIP_VERSION_STR "4.19.19" +#define SIP_VERSION 0x041317 +#define SIP_VERSION_STR "4.19.23" /* diff --git a/sip/siplib/siplib.c b/sip/siplib/siplib.c index e2c90784..a31ddbec 100644 --- a/sip/siplib/siplib.c +++ b/sip/siplib/siplib.c @@ -1,7 +1,7 @@ /* * SIP library code. * - * Copyright (c) 2019 Riverbank Computing Limited + * Copyright (c) 2020 Riverbank Computing Limited * * This file is part of SIP. * @@ -9338,6 +9338,7 @@ static PyObject *sip_api_get_reference(PyObject *self, int key) return NULL; obj = PyDict_GetItem(dict, key_obj); + Py_DECREF(key_obj); Py_XINCREF(obj); return obj; @@ -11320,6 +11321,11 @@ static SIP_SSIZE_T sipSimpleWrapper_getcharbuffer(sipSimpleWrapper *self, */ static void sipSimpleWrapper_dealloc(sipSimpleWrapper *self) { + PyObject *error_type, *error_value, *error_traceback; + + /* Save the current exception, if any. */ + PyErr_Fetch(&error_type, &error_value, &error_traceback); + forgetObject(self); /* @@ -11331,6 +11337,9 @@ static void sipSimpleWrapper_dealloc(sipSimpleWrapper *self) /* Call the standard super-type dealloc. */ PyBaseObject_Type.tp_dealloc((PyObject *)self); + + /* Restore the saved exception. */ + PyErr_Restore(error_type, error_value, error_traceback); } @@ -11727,6 +11736,11 @@ static int sipWrapper_clear(sipWrapper *self) */ static void sipWrapper_dealloc(sipWrapper *self) { + PyObject *error_type, *error_value, *error_traceback; + + /* Save the current exception, if any. */ + PyErr_Fetch(&error_type, &error_value, &error_traceback); + /* * We can't simply call the super-type because things have to be done in a * certain order. The first thing is to get rid of the wrapped instance. @@ -11737,6 +11751,9 @@ static void sipWrapper_dealloc(sipWrapper *self) /* Skip the super-type's dealloc. */ PyBaseObject_Type.tp_dealloc((PyObject *)self); + + /* Restore the saved exception. */ + PyErr_Restore(error_type, error_value, error_traceback); } From e7288e6047cd3c497d374031c383d843827209ba Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Thu, 4 Jun 2020 10:46:28 -0400 Subject: [PATCH 2/9] Add some missing private assignment operators This is needed as part of fixing #1636 as a new version of SIP is required, which makes these changes necessary. (cherry picked from commit 676b95ad1752eb2180e48e1b382ec06b0d28d5e7) --- etg/filesys.py | 1 + etg/grid.py | 1 + etg/renderer.py | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/etg/filesys.py b/etg/filesys.py index 3669cef9..2a8d5aca 100644 --- a/etg/filesys.py +++ b/etg/filesys.py @@ -40,6 +40,7 @@ def run(): c = module.find('wxFileSystem') assert isinstance(c, etgtools.ClassDef) c.addPrivateCopyCtor() + c.addPrivateAssignOp() c.find('AddHandler.handler').transfer = True c.find('RemoveHandler').transferBack = True diff --git a/etg/grid.py b/etg/grid.py index 8d3a5c23..cf76b326 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -183,6 +183,7 @@ def run(): #----------------------------------------------------------------- c = module.find('wxGridBlocks') c.addPrivateDefaultCtor() + c.addPrivateAssignOp() c.addPyMethod('__iter__', '(self)', 'return PyGridBlocksIterator(self)', diff --git a/etg/renderer.py b/etg/renderer.py index 3a888e03..f4a98ff0 100644 --- a/etg/renderer.py +++ b/etg/renderer.py @@ -74,6 +74,12 @@ def run(): c.addPrivateCopyCtor() _addDrawTitleBarBitmap(c, False, draw_tb_bmp_doc) + c = module.find('wxSplitterRenderParams') + c.addPrivateAssignOp() + + c = module.find('wxRendererVersion') + c.addPrivateAssignOp() + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) From f8ced7977b10f681ea23e96c63468af8d929bda0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 Jun 2020 13:00:33 -0700 Subject: [PATCH 3/9] Remove a hack that is no longer needed --- etg/grid.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/etg/grid.py b/etg/grid.py index cf76b326..65ffd7f4 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -405,9 +405,6 @@ def run(): module.find('wxGridCellEditorPtr').piIgnored = True module.find('wxGridCellAttrPtr').piIgnored = True - module.addHeaderCode('#define sipName_ptr "ptr"') - module.addHeaderCode('#define sipName_tocopy "tocopy"') - #----------------------------------------------------------------- # The instanceCode attribute is code that is used to make a default # instance of the class. We can't create them using the same class in From 6683c587473efe3de234cde14335f3d0630accda Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 Jun 2020 13:01:06 -0700 Subject: [PATCH 4/9] Update SIP version and hash for Darwin --- build.py | 4 ++-- wx/include/wxPython/sip.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index d1facd4a..fa9520c2 100755 --- a/build.py +++ b/build.py @@ -87,9 +87,9 @@ wxICON = 'packaging/docset/mondrian.png' # Some tools will be downloaded for the builds. These are the versions and # MD5s of the tool binaries currently in use. -sipCurrentVersion = '4.19.19' +sipCurrentVersion = '4.19.23' sipMD5 = { - 'darwin' : '3309e69f2341f11bac263d7faea19616', + 'darwin' : 'cbd84be2a54eee9a85d53b2b464c9e62', 'win32' : 'fd8be5c5fa369a848e907acad6879846', 'linux32' : 'd0271b47695e74483f0c0d54f24819d5', 'linux64' : '355410a19846768cdeb53efe249aabdb', diff --git a/wx/include/wxPython/sip.h b/wx/include/wxPython/sip.h index bcb53ab2..5dc022ee 100644 --- a/wx/include/wxPython/sip.h +++ b/wx/include/wxPython/sip.h @@ -1,7 +1,7 @@ /* * The SIP module interface. * - * Copyright (c) 2018 Riverbank Computing Limited + * Copyright (c) 2020 Riverbank Computing Limited * * This file is part of SIP. * @@ -54,8 +54,8 @@ extern "C" { /* * Define the SIP version number. */ -#define SIP_VERSION 0x041313 -#define SIP_VERSION_STR "4.19.19" +#define SIP_VERSION 0x041317 +#define SIP_VERSION_STR "4.19.23" /* From 4d0b5f4cf4ecb7d2c71292eed7302fc1048109b5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 Jun 2020 13:10:28 -0700 Subject: [PATCH 5/9] Hard code env vars that have changed defaults on my machine --- bin/build-sip-msw | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/build-sip-msw b/bin/build-sip-msw index 7700bfe3..3aa1b6f9 100644 --- a/bin/build-sip-msw +++ b/bin/build-sip-msw @@ -19,6 +19,16 @@ fi MYBINDIR=$(dirname $(readlink -f $0)) +# This is specific to my machine. If you need to build your own sip then adjust accordingly +export INCLUDE="c:\TOOLS\VisStudio9\VC\ATLMFC\INCLUDE;c:\TOOLS\VisStudio9\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include;" +export LIB="c:\TOOLS\VisStudio9\VC\ATLMFC\LIB;c:\TOOLS\VisStudio9\VC\LIB;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;" +export SDK_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1" +export PATH="/c/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Bin:$PATH" + +echo "INCLUDE: $INCLUDE" +echo "LIB: $LIB" + + cd /c/projects/sip/sip SIPVER=$($PYTHON -c "import sys,configure; sys.stdout.write(configure.sip_version_str);") From a4ae17284ee2b87917ff67a7108f781c09f57804 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 Jun 2020 13:11:34 -0700 Subject: [PATCH 6/9] Also check for msvc_version 14.2 --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index b28b55ed..2eea2600 100644 --- a/wscript +++ b/wscript @@ -79,7 +79,7 @@ def configure(conf): # Visual Studio 2017. However, waf is using "msvc 15.0" to designate # that version rather than "14.1" so we'll need to catch that case and # fix up the msvc_version accordingly. - if msvc_version == "14.1" and sys.version_info >= (3,7): + if msvc_version in ["14.1", "14.2"] and sys.version_info >= (3,7): ##msvc_version = '15.0' # On the other hand, microsoft says that v141 and v140 (Visual From 0c0d9ab27f36a52960d0489302fe4b2e1e1bac1a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 Jun 2020 13:12:00 -0700 Subject: [PATCH 7/9] Add SIP MD5 hash for Windows --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index fa9520c2..6bd4809b 100755 --- a/build.py +++ b/build.py @@ -90,7 +90,7 @@ wxICON = 'packaging/docset/mondrian.png' sipCurrentVersion = '4.19.23' sipMD5 = { 'darwin' : 'cbd84be2a54eee9a85d53b2b464c9e62', - 'win32' : 'fd8be5c5fa369a848e907acad6879846', + 'win32' : 'e9082463286f5233544f801de6d00642', 'linux32' : 'd0271b47695e74483f0c0d54f24819d5', 'linux64' : '355410a19846768cdeb53efe249aabdb', } From cd54afada95d96adceeff262f6557363fdfddaad Mon Sep 17 00:00:00 2001 From: Robin Dunn <> Date: Wed, 17 Jun 2020 15:29:24 -0700 Subject: [PATCH 8/9] Add SIP MD5 hash for linux --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 6bd4809b..40a54ca4 100755 --- a/build.py +++ b/build.py @@ -91,7 +91,7 @@ sipCurrentVersion = '4.19.23' sipMD5 = { 'darwin' : 'cbd84be2a54eee9a85d53b2b464c9e62', 'win32' : 'e9082463286f5233544f801de6d00642', - 'linux32' : 'd0271b47695e74483f0c0d54f24819d5', + 'linux32' : '0147794b52af30d356eed07517da1d48', 'linux64' : '355410a19846768cdeb53efe249aabdb', } From c9ccff3d115631c832901c792c7716111a3faf2b Mon Sep 17 00:00:00 2001 From: Robin Dunn <> Date: Wed, 17 Jun 2020 15:32:28 -0700 Subject: [PATCH 9/9] Add SIP MD5 hash for linux64 --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 40a54ca4..cd77d7d7 100755 --- a/build.py +++ b/build.py @@ -92,7 +92,7 @@ sipMD5 = { 'darwin' : 'cbd84be2a54eee9a85d53b2b464c9e62', 'win32' : 'e9082463286f5233544f801de6d00642', 'linux32' : '0147794b52af30d356eed07517da1d48', - 'linux64' : '355410a19846768cdeb53efe249aabdb', + 'linux64' : '4f8c41f5157a48020b87683538842124', } wafCurrentVersion = '2.0.19'