Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Commit

Permalink
Patch ComTypes with a small fix
Browse files Browse the repository at this point in the history
The fix is obtained from here: enthought/comtypes@7d66f3e
However we can't use that repository since it contains Python 2 code.

Contributes to issue CURA-3823.
  • Loading branch information
Ghostkeeper committed Aug 11, 2017
1 parent f985cfd commit 20f8051
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions projects/python-comtypes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if(BUILD_OS_WINDOWS)
ExternalProject_Add(PythonComtypes
URL https://pypi.python.org/packages/85/11/722b9ce6725bf8160bd8aca68b1e61bd9db422ab12dae28daa7defab2cdc/comtypes-1.1.3-2.zip
URL_MD5 4161cb8bc283a75af85e220ad662d5af
PATCH_COMMAND patch comtypes/__init__.py ${CMAKE_SOURCE_DIR}/cmake/python-comtypes.patch
CONFIGURE_COMMAND ""
BUILD_COMMAND ${PYTHON_EXECUTABLE} setup.py build
INSTALL_COMMAND ${PYTHON_EXECUTABLE} setup.py install --single-version-externally-managed --record=comtypes-install.log
Expand Down
15 changes: 15 additions & 0 deletions projects/python-comtypes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- __init__.py 2017-08-11 14:40:35.464581556 +0200
+++ __init__2.py 2017-08-11 14:40:47.677067679 +0200
@@ -655,8 +655,10 @@
rescode = func(self_, *args, **kw)
# If there is only a single output value, then do not expect it to
# be iterable.
- if len(outargs) == 1: # rescode is not iterable
- return rescode.__ctypes_from_outparam__()
+ if outnum == 1: # rescode is not iterable
+ if len(outargs) == 1:
+ rescode = rescode.__ctypes_from_outparam__()
+ return rescode

rescode = list(rescode)
for outnum, o in outargs.items():

0 comments on commit 20f8051

Please sign in to comment.