comtypes 1.4.7__zip → 1.4.8__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. {comtypes-1.4.7 → comtypes-1.4.8}/CHANGES.txt +18 -0
  2. {comtypes-1.4.7/comtypes.egg-info → comtypes-1.4.8}/PKG-INFO +5 -3
  3. {comtypes-1.4.7 → comtypes-1.4.8}/README.md +4 -2
  4. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/__init__.py +1 -1
  5. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_comobject.py +0 -1
  6. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_memberspec.py +1 -1
  7. comtypes-1.4.8/comtypes/_meta.py +95 -0
  8. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_npsupport.py +2 -1
  9. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/__init__.py +1 -0
  10. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/misc.py +20 -39
  11. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/unknwn.py +94 -69
  12. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/__init__.py +21 -31
  13. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_code_cache.py +1 -0
  14. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_events.py +0 -1
  15. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_generate.py +5 -5
  16. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/lazybind.py +0 -5
  17. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/git.py +1 -0
  18. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/hints.pyi +4 -4
  19. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/persist.py +7 -7
  20. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/safearray.py +2 -6
  21. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/__init__.py +1 -0
  22. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/register.py +1 -0
  23. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/shelllink.py +48 -43
  24. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.py +1 -1
  25. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.py +1 -1
  26. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/__init__.py +0 -1
  27. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/find_memleak.py +0 -1
  28. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_agilent.py +0 -1
  29. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_clear_cache.py +1 -0
  30. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_createwrappers.py +0 -2
  31. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispinterface.py +0 -1
  32. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_excel.py +0 -1
  33. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_inout_args.py +1 -1
  34. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_server.py +6 -0
  35. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_shelllink.py +10 -14
  36. comtypes-1.4.8/comtypes/test/test_stream.py +131 -0
  37. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_typeannotator.py +1 -1
  38. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_urlhistory.py +1 -0
  39. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_variant.py +0 -2
  40. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/namespaces.py +97 -27
  41. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/typeannotator.py +2 -4
  42. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/tlbparser.py +33 -32
  43. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/typedesc.py +2 -2
  44. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/typeinfo.py +21 -25
  45. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/util.py +1 -0
  46. {comtypes-1.4.7 → comtypes-1.4.8/comtypes.egg-info}/PKG-INFO +5 -3
  47. comtypes-1.4.8/pyproject.toml +54 -0
  48. comtypes-1.4.7/comtypes/_meta.py +0 -70
  49. comtypes-1.4.7/comtypes/test/test_stream.py +0 -53
  50. comtypes-1.4.7/pyproject.toml +0 -3
  51. {comtypes-1.4.7 → comtypes-1.4.8}/LICENSE.txt +0 -0
  52. {comtypes-1.4.7 → comtypes-1.4.8}/MANIFEST.in +0 -0
  53. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/GUID.py +0 -0
  54. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_idl_stuff.py +0 -0
  55. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/bstr.py +0 -0
  56. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_py_instance_method.py +0 -0
  57. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_safearray.py +0 -0
  58. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_tlib_version_checker.py +0 -0
  59. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/automation.py +0 -0
  60. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/clear_cache.py +0 -0
  61. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_constants.py +0 -0
  62. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/dynamic.py +0 -0
  63. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/connectionpoints.py +0 -0
  64. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/errorinfo.py +0 -0
  65. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/hresult.py +0 -0
  66. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/logutil.py +0 -0
  67. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/messageloop.py +0 -0
  68. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/patcher.py +0 -0
  69. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/automation.py +0 -0
  70. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/connectionpoints.py +0 -0
  71. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/inprocserver.py +0 -0
  72. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/localserver.py +0 -0
  73. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/w_getopt.py +0 -0
  74. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/stream.py +0 -0
  75. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.idl +0 -0
  76. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.tlb +0 -0
  77. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.idl +0 -0
  78. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.tlb +0 -0
  79. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mylib.idl +0 -0
  80. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mylib.tlb +0 -0
  81. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mytypelib.idl +0 -0
  82. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/runtests.py +0 -0
  83. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/setup.py +0 -0
  84. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_BSTR.py +0 -0
  85. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_DISPPARAMS.py +0 -0
  86. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_GUID.py +0 -0
  87. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_QueryService.py +0 -0
  88. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_avmc.py +0 -0
  89. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_basic.py +0 -0
  90. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_casesensitivity.py +0 -0
  91. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client.py +0 -0
  92. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client_dynamic.py +0 -0
  93. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client_regenerate_modules.py +0 -0
  94. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_collections.py +0 -0
  95. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_comserver.py +0 -0
  96. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dict.py +0 -0
  97. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispifc_records.py +0 -0
  98. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispifc_safearrays.py +0 -0
  99. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dyndispatch.py +0 -0
  100. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_findgendir.py +0 -0
  101. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_getactiveobj.py +0 -0
  102. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_ie.py +0 -0
  103. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_ienum.py +0 -0
  104. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_imfattributes.py +0 -0
  105. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_jscript.js +0 -0
  106. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_midl_safearray_create.py +0 -0
  107. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_monikers.py +0 -0
  108. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_msscript.py +0 -0
  109. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_npsupport.py +0 -0
  110. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_outparam.py +0 -0
  111. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_persist.py +0 -0
  112. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_propputref.py +0 -0
  113. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_pump_events.py +0 -0
  114. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_recordinfo.py +0 -0
  115. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_safearray.py +0 -0
  116. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_sapi.py +0 -0
  117. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_showevents.py +0 -0
  118. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_storage.py +0 -0
  119. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_subinterface.py +0 -0
  120. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_typeinfo.py +0 -0
  121. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_win32com_interop.py +0 -0
  122. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_wmi.py +0 -0
  123. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_word.py +0 -0
  124. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/urlhist.tlb +0 -0
  125. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/__init__.py +0 -0
  126. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/__init__.py +0 -0
  127. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/codegenerator.py +0 -0
  128. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/helpers.py +0 -0
  129. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/modulenamer.py +0 -0
  130. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/packing.py +0 -0
  131. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/typedesc_base.py +0 -0
  132. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/viewobject.py +0 -0
  133. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/SOURCES.txt +0 -0
  134. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/dependency_links.txt +0 -0
  135. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/entry_points.txt +0 -0
  136. {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/top_level.txt +0 -0
  137. {comtypes-1.4.7 → comtypes-1.4.8}/setup.cfg +0 -0
  138. {comtypes-1.4.7 → comtypes-1.4.8}/setup.py +0 -0
@@ -1,6 +1,24 @@
1
1
  Comtypes CHANGELOG
2
2
  ==================
3
3
 
4
+ Release 1.4.8
5
+ --------------
6
+ * Remove Python 3.7 and add Python 3.13 to the CI pipelines. By @junkmd.
7
+ * Add constant definitions to ``shelllink``. By @junkmd.
8
+ * Add more tests to ``test_stream``. By @junkmd.
9
+ * Add the ``void_type`` definition to ``tlbparser``. By @junkmd.
10
+ * Modernize ``tools.tlbparser.get_tlib_filename``. By @junkmd.
11
+ * Extract the methods for parsing externals and dual interfaces from ``Parser.parse_typeinfo``. By @junkmd.
12
+ * Fix type annotations referenced by ``tlbparser``. By @junkmd.
13
+ * Modernize ``codegenerator.namespaces``. By @junkmd.
14
+ * Improve static typing for ``CoGetClassObject`` and ``GetClassObject``. By @junkmd.
15
+ * Refactor the ``__new__`` methods of ``_cominterface_meta`` and ``_coclass_meta``. By @junkmd.
16
+ * Prevent errors caused by defining members with the same name within an enum type. By @junkmd.
17
+ * Remove remaining ``__cmp__`` methods. By @newwingbird.
18
+ * Remove remaining ``from __future__ import print_function`` lines. By @newwingbird.
19
+ * Prevent ``itf`` to be an unbound variable in ``_cominterface_meta.__get_baseinterface_methodcount``. By @newwingbird.
20
+ * Modify the metaclasses to ensure compatibility with Python 3.13 and earlier versions. By @junkmd.
21
+
4
22
  Release 1.4.7
5
23
  --------------
6
24
  * Improve ``_CArrayType`` alias import. By @junkmd.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: comtypes
3
- Version: 1.4.7
3
+ Version: 1.4.8
4
4
  Summary: Pure Python COM package
5
5
  Home-page: https://github.com/enthought/comtypes
6
6
  Download-URL: https://github.com/enthought/comtypes/releases
@@ -20,8 +20,9 @@ License-File: LICENSE.txt
20
20
  # comtypes
21
21
 
22
22
  ![Works on Windows only](https://img.shields.io/badge/-Windows-0078D6.svg?logo=windows&style=flat)
23
- [![PyPI version](https://badge.fury.io/py/comtypes.svg)](https://pypi.org/project/comtypes/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - License](https://img.shields.io/pypi/l/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/comtypes)](https://pypi.org/project/comtypes/)
24
- [![GitHub Repo stars](https://img.shields.io/github/stars/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/stargazers) [![GitHub forks](https://img.shields.io/github/forks/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/network/members)
23
+ [![PyPI version](https://badge.fury.io/py/comtypes.svg)](https://pypi.org/project/comtypes/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Python Requires](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpypi.org%2Fpypi%2Fcomtypes%2Fjson&query=info.requires_python&label=Python Requires)](https://pypi.org/project/comtypes/)
24
+ [![PyPI - License](https://img.shields.io/pypi/l/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/comtypes)](https://pypi.org/project/comtypes/)
25
+ [![GitHub Repo stars](https://img.shields.io/github/stars/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/stargazers) [![GitHub forks](https://img.shields.io/github/forks/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/network/members) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
25
26
  [![Tidelift Subscription](https://tidelift.com/badges/package/pypi/comtypes)](https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes&utm_medium=readme)
26
27
 
27
28
 
@@ -30,6 +31,7 @@ License-File: LICENSE.txt
30
31
  `comtypes` allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.
31
32
 
32
33
  `comtypes` requires Windows and Python 3.8 or later.
34
+ - Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
33
35
  - Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
34
36
  - Version [1.2.1](https://pypi.org/project/comtypes/1.2.1/) is the last version to support Python 2.7 and 3.3–3.6.
35
37
  - `comtypes` does not work with Python 3.8.1 as reported in [GH-202](https://github.com/enthought/comtypes/issues/202). This bug has been fixed in Python >= 3.8.2.
@@ -1,8 +1,9 @@
1
1
  # comtypes
2
2
 
3
3
  ![Works on Windows only](https://img.shields.io/badge/-Windows-0078D6.svg?logo=windows&style=flat)
4
- [![PyPI version](https://badge.fury.io/py/comtypes.svg)](https://pypi.org/project/comtypes/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - License](https://img.shields.io/pypi/l/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/comtypes)](https://pypi.org/project/comtypes/)
5
- [![GitHub Repo stars](https://img.shields.io/github/stars/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/stargazers) [![GitHub forks](https://img.shields.io/github/forks/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/network/members)
4
+ [![PyPI version](https://badge.fury.io/py/comtypes.svg)](https://pypi.org/project/comtypes/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Python Requires](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpypi.org%2Fpypi%2Fcomtypes%2Fjson&query=info.requires_python&label=Python&nbsp;Requires)](https://pypi.org/project/comtypes/)
5
+ [![PyPI - License](https://img.shields.io/pypi/l/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/comtypes)](https://pypi.org/project/comtypes/)
6
+ [![GitHub Repo stars](https://img.shields.io/github/stars/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/stargazers) [![GitHub forks](https://img.shields.io/github/forks/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/network/members) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
6
7
  [![Tidelift Subscription](https://tidelift.com/badges/package/pypi/comtypes)](https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes&utm_medium=readme)
7
8
 
8
9
 
@@ -11,6 +12,7 @@
11
12
  `comtypes` allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.
12
13
 
13
14
  `comtypes` requires Windows and Python 3.8 or later.
15
+ - Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
14
16
  - Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
15
17
  - Version [1.2.1](https://pypi.org/project/comtypes/1.2.1/) is the last version to support Python 2.7 and 3.3–3.6.
16
18
  - `comtypes` does not work with Python 3.8.1 as reported in [GH-202](https://github.com/enthought/comtypes/issues/202). This bug has been fixed in Python >= 3.8.2.
@@ -1,5 +1,5 @@
1
1
  # comtypes version numbers follow semver (http://semver.org/) and PEP 440
2
- __version__ = "1.4.7"
2
+ __version__ = "1.4.8"
3
3
 
4
4
  try:
5
5
  from _ctypes import COMError # noqa
@@ -349,7 +349,6 @@ else:
349
349
 
350
350
 
351
351
  class LocalServer(object):
352
-
353
352
  _queue = None
354
353
 
355
354
  def run(self, classobjects):
@@ -43,7 +43,7 @@ def _unpack_argspec(
43
43
 
44
44
 
45
45
  def _resolve_argspec(
46
- items: Tuple[_ArgSpecElmType, ...]
46
+ items: Tuple[_ArgSpecElmType, ...],
47
47
  ) -> Tuple[Tuple[_ParamFlagType, ...], Tuple[Type[_CData], ...]]:
48
48
  """Unpacks and converts from argspec to paramflags and argtypes.
49
49
 
@@ -0,0 +1,95 @@
1
+ # comtypes._meta helper module
2
+ from ctypes import POINTER, c_void_p, cast
3
+ import comtypes
4
+
5
+ ################################################################
6
+ # metaclass for CoClass (in comtypes/__init__.py)
7
+
8
+
9
+ def _wrap_coclass(self):
10
+ # We are an IUnknown pointer, represented as a c_void_p instance,
11
+ # but we really want this interface:
12
+ itf = self._com_interfaces_[0]
13
+ punk = cast(self, POINTER(itf))
14
+ result = punk.QueryInterface(itf)
15
+ result.__dict__["__clsid"] = str(self._reg_clsid_)
16
+ return result
17
+
18
+
19
+ def _coclass_from_param(cls, obj):
20
+ if isinstance(obj, (cls._com_interfaces_[0], cls)):
21
+ return obj
22
+ raise TypeError(obj)
23
+
24
+
25
+ #
26
+ # The mro() of a POINTER(App) type, where class App is a subclass of CoClass:
27
+ #
28
+ # POINTER(App)
29
+ # App
30
+ # CoClass
31
+ # c_void_p
32
+ # _SimpleCData
33
+ # _CData
34
+ # object
35
+
36
+
37
+ class _coclass_meta(type):
38
+ # metaclass for CoClass
39
+ #
40
+ # When a CoClass subclass is created, create a POINTER(...) type
41
+ # for that class, with bases <coclass> and c_void_p. Also, the
42
+ # POINTER(...) type gets a __ctypes_from_outparam__ method which
43
+ # will QueryInterface for the default interface: the first one on
44
+ # the coclass' _com_interfaces_ list.
45
+ def __new__(cls, name, bases, namespace):
46
+ self = type.__new__(cls, name, bases, namespace)
47
+ if bases == (object,):
48
+ # HACK: Could this conditional branch be removed since it is never reached?
49
+ # Since definition is `class CoClass(COMObject, metaclass=_coclass_meta)`,
50
+ # the `bases` parameter passed to the `_coclass_meta.__new__` would be
51
+ # `(COMObject,)`.
52
+ # Moreover, since the `COMObject` derives from `object` and does not specify
53
+ # a metaclass, `(object,)` will not be passed as the `bases` parameter
54
+ # to the `_coclass_meta.__new__`.
55
+ # The reason for this implementation might be a remnant of the differences
56
+ # in how metaclasses work between Python 3.x and Python 2.x.
57
+ # If there are no problems with the versions of Python that `comtypes`
58
+ # supports, this removal could make the process flow easier to understand.
59
+ return self
60
+ # XXX We should insist that a _reg_clsid_ is present.
61
+ if "_reg_clsid_" in namespace:
62
+ clsid = namespace["_reg_clsid_"]
63
+ comtypes.com_coclass_registry[str(clsid)] = self
64
+
65
+ # `_coclass_pointer_meta` is a subclass inherited from `_coclass_meta`.
66
+ # In other words, when the `__new__` method of this metaclass is called, an
67
+ # instance of `_coclass_pointer_meta` might be created and assigned to `self`.
68
+ if isinstance(self, _coclass_pointer_meta):
69
+ # `self` is the `_coclass_pointer_meta` type or a `POINTER(coclass)` type.
70
+ # Prevent creating/registering a pointer to a pointer (to a pointer...),
71
+ # or specifying the metaclass type instance in the `bases` parameter when
72
+ # instantiating it, which would lead to infinite recursion.
73
+ # Depending on a version or revision of Python, this may be essential.
74
+ return self
75
+
76
+ PTR = _coclass_pointer_meta(
77
+ f"POINTER({self.__name__})",
78
+ (self, c_void_p),
79
+ {
80
+ "__ctypes_from_outparam__": _wrap_coclass,
81
+ "from_param": classmethod(_coclass_from_param),
82
+ },
83
+ )
84
+ from ctypes import _pointer_type_cache # type: ignore
85
+
86
+ _pointer_type_cache[self] = PTR
87
+
88
+ return self
89
+
90
+
91
+ # will not work if we change the order of the two base classes!
92
+ class _coclass_pointer_meta(type(c_void_p), _coclass_meta):
93
+ # metaclass for CoClass pointer
94
+
95
+ pass # no functionality, but needed to avoid a metaclass conflict
@@ -1,4 +1,5 @@
1
- """ Consolidation of numpy support utilities. """
1
+ """Consolidation of numpy support utilities."""
2
+
2
3
  import sys
3
4
 
4
5
  is_64bits = sys.maxsize > 2**32
@@ -12,4 +12,5 @@ This subpackage is called simultaneously with the initialization of `comtypes`.
12
12
  So it is necessary to maintain minimal settings to keep the lightweight action
13
13
  when the package is initialized.
14
14
  """
15
+
15
16
  from comtypes._post_coinit.unknwn import _shutdown # noqa
@@ -88,15 +88,9 @@ class IServiceProvider(IUnknown):
88
88
 
89
89
 
90
90
  @overload
91
- def CoGetObject(displayname: str, interface: None) -> IUnknown:
92
- ...
93
-
94
-
91
+ def CoGetObject(displayname: str, interface: None) -> IUnknown: ...
95
92
  @overload
96
- def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown:
97
- ...
98
-
99
-
93
+ def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown: ...
100
94
  def CoGetObject(displayname: str, interface: Optional[Type[IUnknown]]) -> IUnknown:
101
95
  """Convert a displayname to a moniker, then bind and return the object
102
96
  identified by the moniker."""
@@ -117,20 +111,14 @@ def CoCreateInstance(
117
111
  interface: None = None,
118
112
  clsctx: Optional[int] = None,
119
113
  punkouter: Optional[_pUnkOuter] = None,
120
- ) -> IUnknown:
121
- ...
122
-
123
-
114
+ ) -> IUnknown: ...
124
115
  @overload
125
116
  def CoCreateInstance(
126
117
  clsid: GUID,
127
118
  interface: Type[_T_IUnknown],
128
119
  clsctx: Optional[int] = None,
129
120
  punkouter: Optional[_pUnkOuter] = None,
130
- ) -> _T_IUnknown:
131
- ...
132
-
133
-
121
+ ) -> _T_IUnknown: ...
134
122
  def CoCreateInstance(
135
123
  clsid: GUID,
136
124
  interface: Optional[Type[IUnknown]] = None,
@@ -153,14 +141,19 @@ def CoCreateInstance(
153
141
  if TYPE_CHECKING:
154
142
 
155
143
  @overload
156
- def CoGetClassObject(clsid, clsctx=None, pServerInfo=None, interface=None):
157
- # type: (GUID, Optional[int], Optional[COSERVERINFO], None) -> hints.IClassFactory
158
- pass
159
-
144
+ def CoGetClassObject(
145
+ clsid: GUID,
146
+ clsctx: Optional[int] = None,
147
+ pServerInfo: "Optional[COSERVERINFO]" = None,
148
+ interface: None = None,
149
+ ) -> hints.IClassFactory: ...
160
150
  @overload
161
- def CoGetClassObject(clsid, clsctx=None, pServerInfo=None, interface=None):
162
- # type: (GUID, Optional[int], Optional[COSERVERINFO], Type[_T_IUnknown]) -> _T_IUnknown
163
- pass
151
+ def CoGetClassObject(
152
+ clsid: GUID,
153
+ clsctx: Optional[int] = None,
154
+ pServerInfo: "Optional[COSERVERINFO]" = None,
155
+ interface: Type[_T_IUnknown] = hints.IClassFactory,
156
+ ) -> _T_IUnknown: ...
164
157
 
165
158
 
166
159
  def CoGetClassObject(clsid, clsctx=None, pServerInfo=None, interface=None):
@@ -177,15 +170,9 @@ def CoGetClassObject(clsid, clsctx=None, pServerInfo=None, interface=None):
177
170
 
178
171
 
179
172
  @overload
180
- def GetActiveObject(clsid: GUID, interface: None = None) -> IUnknown:
181
- ...
182
-
183
-
173
+ def GetActiveObject(clsid: GUID, interface: None = None) -> IUnknown: ...
184
174
  @overload
185
- def GetActiveObject(clsid: GUID, interface: Type[_T_IUnknown]) -> _T_IUnknown:
186
- ...
187
-
188
-
175
+ def GetActiveObject(clsid: GUID, interface: Type[_T_IUnknown]) -> _T_IUnknown: ...
189
176
  def GetActiveObject(
190
177
  clsid: GUID, interface: Optional[Type[IUnknown]] = None
191
178
  ) -> IUnknown:
@@ -335,10 +322,7 @@ def CoCreateInstanceEx(
335
322
  clsctx: Optional[int] = None,
336
323
  machine: Optional[str] = None,
337
324
  pServerInfo: Optional[COSERVERINFO] = None,
338
- ) -> IUnknown:
339
- ...
340
-
341
-
325
+ ) -> IUnknown: ...
342
326
  @overload
343
327
  def CoCreateInstanceEx(
344
328
  clsid: GUID,
@@ -346,10 +330,7 @@ def CoCreateInstanceEx(
346
330
  clsctx: Optional[int] = None,
347
331
  machine: Optional[str] = None,
348
332
  pServerInfo: Optional[COSERVERINFO] = None,
349
- ) -> _T_IUnknown:
350
- ...
351
-
352
-
333
+ ) -> _T_IUnknown: ...
353
334
  def CoCreateInstanceEx(
354
335
  clsid: GUID,
355
336
  interface: Optional[Type[IUnknown]] = None,
@@ -69,12 +69,37 @@ class _cominterface_meta(type):
69
69
  def __new__(cls, name, bases, namespace):
70
70
  methods = namespace.pop("_methods_", None)
71
71
  dispmethods = namespace.pop("_disp_methods_", None)
72
- new_cls = type.__new__(cls, name, bases, namespace)
72
+ self = type.__new__(cls, name, bases, namespace)
73
73
 
74
74
  if methods is not None:
75
- new_cls._methods_ = methods
75
+ self._methods_ = methods
76
76
  if dispmethods is not None:
77
- new_cls._disp_methods_ = dispmethods
77
+ self._disp_methods_ = dispmethods
78
+
79
+ # ` _compointer_meta` is a subclass inherited from `_cominterface_meta`.
80
+ # `_compointer_base` uses `_compointer_meta` as its metaclass.
81
+ # In other words, when the `__new__` method of this metaclass is called,
82
+ # `_compointer_base` type or an subclass of it might be created and assigned
83
+ # to `self`.
84
+ if bases == (c_void_p,):
85
+ # `self` is the `_compointer_base` type.
86
+ # On some versions of Python, `_compointer_base` is not yet available in
87
+ # the accessible namespace at this point in its initialization, and
88
+ # referencing it could raise a `NameError`.
89
+ # This metaclass is intended to be used only as a base class for defining
90
+ # the `_compointer_meta` or as the metaclass for the `IUnknown`, so the
91
+ # situation where the `bases` parameter is `(c_void_p,)` is limited to when
92
+ # the `_compointer_meta` is specified as the metaclass of the
93
+ # `_compointer_base`.
94
+ # Prevent specifying the metaclass type instance in the `bases` parameter
95
+ # when instantiating it, as this would lead to infinite recursion.
96
+ return self
97
+ if issubclass(self, _compointer_base):
98
+ # `self` is a `POINTER(interface)` type.
99
+ # Prevent creating/registering a pointer to a pointer (to a pointer...),
100
+ # which would lead to infinite recursion.
101
+ # Depending on a version or revision of Python, this may be essential.
102
+ return self
78
103
 
79
104
  # If we sublass a COM interface, for example:
80
105
  #
@@ -85,49 +110,67 @@ class _cominterface_meta(type):
85
110
  # subclass of POINTER(IUnknown) because of the way ctypes
86
111
  # typechecks work.
87
112
  if bases == (object,):
88
- _ptr_bases = (new_cls, _compointer_base)
113
+ # `self` is the `IUnknown` type.
114
+ _ptr_bases = (self, _compointer_base)
89
115
  else:
90
- _ptr_bases = (new_cls, POINTER(bases[0]))
91
-
92
- # The interface 'new_cls' is used as a mixin.
116
+ # `self` is an interface type derived from `IUnknown`.
117
+ _ptr_bases = (self, POINTER(bases[0]))
118
+
119
+ # The interface 'self' is used as a mixin.
120
+ # HACK: Could `type(_compointer_base)` be replaced with `_compointer_meta`?
121
+ # `type(klass)` returns its metaclass.
122
+ # Since this specification, `type(_compointer_base)` will return the
123
+ # `_compointer_meta` type as per the class definition.
124
+ # The reason for this implementation might be a remnant of the differences in
125
+ # how metaclasses work between Python 3.x and Python 2.x.
126
+ # If there are no problems with the versions of Python that `comtypes`
127
+ # supports, this replacement could make the process flow easier to understand.
93
128
  p = type(_compointer_base)(
94
- "POINTER(%s)" % new_cls.__name__,
129
+ f"POINTER({self.__name__})",
95
130
  _ptr_bases,
96
- {"__com_interface__": new_cls, "_needs_com_addref_": None},
131
+ {"__com_interface__": self, "_needs_com_addref_": None},
97
132
  )
98
133
 
99
- from ctypes import _pointer_type_cache
134
+ from ctypes import _pointer_type_cache # type: ignore
100
135
 
101
- _pointer_type_cache[new_cls] = p
136
+ _pointer_type_cache[self] = p
102
137
 
103
- if new_cls._case_insensitive_:
138
+ if self._case_insensitive_:
139
+ self._patch_case_insensitive_to_ptr_type(p)
140
+ self._patch_reference_fix_to_ptrptr_type(POINTER(p)) # type: ignore
104
141
 
105
- @patcher.Patch(p)
106
- class CaseInsensitive(object):
107
- # case insensitive attributes for COM methods and properties
108
- def __getattr__(self, name):
109
- """Implement case insensitive access to methods and properties"""
110
- try:
111
- fixed_name = self.__map_case__[name.lower()]
112
- except KeyError:
113
- raise AttributeError(name)
114
- if fixed_name != name: # prevent unbounded recursion
115
- return getattr(self, fixed_name)
116
- raise AttributeError(name)
117
-
118
- # __setattr__ is pretty heavy-weight, because it is called for
119
- # EVERY attribute assignment. Settings a non-com attribute
120
- # through this function takes 8.6 usec, while without this
121
- # function it takes 0.7 sec - 12 times slower.
122
- #
123
- # How much faster would this be if implemented in C?
124
- def __setattr__(self, name, value):
125
- """Implement case insensitive access to methods and properties"""
126
- object.__setattr__(
127
- self, self.__map_case__.get(name.lower(), name), value
128
- )
129
-
130
- @patcher.Patch(POINTER(p))
142
+ return self
143
+
144
+ @staticmethod
145
+ def _patch_case_insensitive_to_ptr_type(p: Type) -> None:
146
+ @patcher.Patch(p)
147
+ class CaseInsensitive(object):
148
+ # case insensitive attributes for COM methods and properties
149
+ def __getattr__(self, name):
150
+ """Implement case insensitive access to methods and properties"""
151
+ try:
152
+ fixed_name = self.__map_case__[name.lower()]
153
+ except KeyError:
154
+ raise AttributeError(name) # Should we use exception-chaining?
155
+ if fixed_name != name: # prevent unbounded recursion
156
+ return getattr(self, fixed_name)
157
+ raise AttributeError(name)
158
+
159
+ # __setattr__ is pretty heavy-weight, because it is called for
160
+ # EVERY attribute assignment. Settings a non-com attribute
161
+ # through this function takes 8.6 usec, while without this
162
+ # function it takes 0.7 sec - 12 times slower.
163
+ #
164
+ # How much faster would this be if implemented in C?
165
+ def __setattr__(self, name, value):
166
+ """Implement case insensitive access to methods and properties"""
167
+ object.__setattr__(
168
+ self, self.__map_case__.get(name.lower(), name), value
169
+ )
170
+
171
+ @staticmethod
172
+ def _patch_reference_fix_to_ptrptr_type(pp: Type) -> None:
173
+ @patcher.Patch(pp)
131
174
  class ReferenceFix(object):
132
175
  def __setitem__(self, index, value):
133
176
  # We override the __setitem__ method of the
@@ -149,13 +192,11 @@ class _cominterface_meta(type):
149
192
  # CopyComPointer should do if index != 0.
150
193
  if bool(value):
151
194
  value.AddRef()
152
- super(POINTER(p), self).__setitem__(index, value)
195
+ super(pp, self).__setitem__(index, value) # type: ignore
153
196
  return
154
197
  from _ctypes import CopyComPointer
155
198
 
156
- CopyComPointer(value, self)
157
-
158
- return new_cls
199
+ CopyComPointer(value, self) # type: ignore
159
200
 
160
201
  def __setattr__(self, name, value):
161
202
  if name == "_methods_":
@@ -308,16 +349,13 @@ class _cominterface_meta(type):
308
349
 
309
350
  def __get_baseinterface_methodcount(self):
310
351
  "Return the number of com methods in the base interfaces"
311
- try:
312
- result = 0
313
- for itf in self.mro()[1:-1]:
314
- result += len(itf.__dict__["_methods_"])
315
- return result
316
- except KeyError as err:
317
- (name,) = err.args
318
- if name == "_methods_":
319
- raise TypeError("baseinterface '%s' has no _methods_" % itf.__name__)
320
- raise
352
+ result = 0
353
+ for itf in self.mro()[1:-1]:
354
+ if "_methods_" in vars(itf):
355
+ result += len(vars(itf)["_methods_"])
356
+ else:
357
+ raise TypeError(f"baseinterface '{itf.__name__}' has no _methods_")
358
+ return result
321
359
 
322
360
  def _make_methods(self, methods: List[_ComMemberSpec]) -> None:
323
361
  if self._case_insensitive_:
@@ -363,9 +401,11 @@ class _cominterface_meta(type):
363
401
  ################################################################
364
402
 
365
403
 
404
+ # will not work if we change the order of the two base classes!
366
405
  class _compointer_meta(type(c_void_p), _cominterface_meta):
367
- "metaclass for COM interface pointer classes"
368
- # no functionality, but needed to avoid a metaclass conflict
406
+ """metaclass for COM interface pointer classes"""
407
+
408
+ pass # no functionality, but needed to avoid a metaclass conflict
369
409
 
370
410
 
371
411
  class _compointer_base(c_void_p, metaclass=_compointer_meta):
@@ -385,21 +425,6 @@ class _compointer_base(c_void_p, metaclass=_compointer_meta):
385
425
  _debug("Release %s", self)
386
426
  self.Release()
387
427
 
388
- def __cmp__(self, other):
389
- """Compare pointers to COM interfaces."""
390
- # COM identity rule
391
- #
392
- # XXX To compare COM interface pointers, should we
393
- # automatically QueryInterface for IUnknown on both items, and
394
- # compare the pointer values?
395
- if not isinstance(other, _compointer_base):
396
- return 1
397
-
398
- # get the value property of the c_void_p baseclass, this is the pointer value
399
- return cmp(
400
- super(_compointer_base, self).value, super(_compointer_base, other).value
401
- )
402
-
403
428
  def __eq__(self, other):
404
429
  if not isinstance(other, _compointer_base):
405
430
  return False
@@ -138,22 +138,17 @@ wrap = GetBestInterface
138
138
  # Should we do this for POINTER(IUnknown) also?
139
139
  ctypes.POINTER(automation.IDispatch).__ctypes_from_outparam__ = wrap_outparam # type: ignore
140
140
 
141
+
141
142
  ################################################################
142
143
  #
143
144
  # Object creation
144
145
  #
145
146
  @overload
146
- def GetActiveObject(progid: _UnionT[str, CoClass, GUID]) -> Any:
147
- ...
148
-
149
-
147
+ def GetActiveObject(progid: _UnionT[str, CoClass, GUID]) -> Any: ...
150
148
  @overload
151
149
  def GetActiveObject(
152
150
  progid: _UnionT[str, CoClass, GUID], interface: Type[_T_IUnknown]
153
- ) -> _T_IUnknown:
154
- ...
155
-
156
-
151
+ ) -> _T_IUnknown: ...
157
152
  def GetActiveObject(
158
153
  progid: _UnionT[str, CoClass, GUID],
159
154
  interface: Optional[Type[IUnknown]] = None,
@@ -193,14 +188,19 @@ def _manage(
193
188
  if TYPE_CHECKING:
194
189
 
195
190
  @overload
196
- def GetClassObject(progid, clsctx=None, pServerInfo=None):
197
- # type: (_UnionT[str, CoClass, GUID], Optional[int], Optional[comtypes.COSERVERINFO]) -> hints.IClassFactory
198
- pass
199
-
191
+ def GetClassObject(
192
+ progid: _UnionT[str, CoClass, GUID],
193
+ clsctx: Optional[int] = None,
194
+ pServerInfo: Optional[comtypes.COSERVERINFO] = None,
195
+ interface: None = None,
196
+ ) -> hints.IClassFactory: ...
200
197
  @overload
201
- def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):
202
- # type: (_UnionT[str, CoClass, GUID], Optional[int], Optional[comtypes.COSERVERINFO], Optional[Type[_T_IUnknown]]) -> _T_IUnknown
203
- pass
198
+ def GetClassObject(
199
+ progid: _UnionT[str, CoClass, GUID],
200
+ clsctx: Optional[int] = None,
201
+ pServerInfo: Optional[comtypes.COSERVERINFO] = None,
202
+ interface: Type[_T_IUnknown] = hints.IClassFactory,
203
+ ) -> _T_IUnknown: ...
204
204
 
205
205
 
206
206
  def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):
@@ -216,10 +216,7 @@ def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):
216
216
 
217
217
 
218
218
  @overload
219
- def CreateObject(progid: _UnionT[str, Type[CoClass], GUID]) -> Any:
220
- ...
221
-
222
-
219
+ def CreateObject(progid: _UnionT[str, Type[CoClass], GUID]) -> Any: ...
223
220
  @overload
224
221
  def CreateObject(
225
222
  progid: _UnionT[str, Type[CoClass], GUID],
@@ -228,10 +225,7 @@ def CreateObject(
228
225
  interface: Optional[Type[_T_IUnknown]] = None,
229
226
  dynamic: bool = ...,
230
227
  pServerInfo: Optional[comtypes.COSERVERINFO] = None,
231
- ) -> _T_IUnknown:
232
- ...
233
-
234
-
228
+ ) -> _T_IUnknown: ...
235
229
  def CreateObject(
236
230
  progid: _UnionT[str, Type[CoClass], GUID], # which object to create
237
231
  clsctx: Optional[int] = None, # how to create the object
@@ -297,15 +291,11 @@ def CreateObject(
297
291
 
298
292
 
299
293
  @overload
300
- def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown:
301
- ...
302
-
303
-
294
+ def CoGetObject(displayname: str, interface: Type[_T_IUnknown]) -> _T_IUnknown: ...
304
295
  @overload
305
- def CoGetObject(displayname: str, interface: None = None, dynamic: bool = False) -> Any:
306
- ...
307
-
308
-
296
+ def CoGetObject(
297
+ displayname: str, interface: None = None, dynamic: bool = False
298
+ ) -> Any: ...
309
299
  def CoGetObject(
310
300
  displayname: str,
311
301
  interface: Optional[Type[comtypes.IUnknown]] = None,
@@ -4,6 +4,7 @@ The main function is _find_gen_dir(), which on-demand creates the
4
4
  comtypes.gen package and returns a directory where generated code can
5
5
  be written to.
6
6
  """
7
+
7
8
  import ctypes, logging, os, sys, tempfile, types
8
9
  from ctypes import wintypes
9
10
 
@@ -1,4 +1,3 @@
1
- from __future__ import print_function
2
1
  import ctypes
3
2
  import traceback
4
3
  import comtypes