Accessing `Gimp.CpuAccelFlags` fails in Python
Environment/Versions
- GIMP version: 2.99.16
- Package: Installer from gimp.org
- Operating System: Windows
Description of the bug
Accessing the Gimp.CpuAccelFlags
object in Python code fails, most likely because the GIMP_CPU_ACCEL_X86_MMX
flag is too big to fit in 4 bytes as a signed integer.
Reproduction
Is the bug reproducible? Always
Reproduction steps:
Open the Python-Fu console and type
Gimp.CpuAccelFlags
The following exception is thrown:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\GIMP 2.99\lib\python3.10\site-packages\gi\module.py", line 160, in getattr
setattr(wrapper, value_name, wrapper(value_info.get_value()))
OverflowError: Python int too large to convert to C long
Additional information
While I find it unlikely that a Python plug-in developer would want to use this particular set of flags, the exception prevents PyCharm from auto-generating stubs for the entire gi.repository.Gimp
module (to display code completion suggestions in the IDE). Stubs for other GIMP and GTK binary modules are generated properly.
Edited by Kamil Burda