You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both callback_bug and no_bug (attached) contain three similar files:
main.py, which drives the program
emulation.py which contains the emulation implementation
the_callback.py / some_func.py
We can run both programs in emulation mode, taking care to update the PYTHONPATH with the location of lpython.py: $ PYTHONPATH=/home/emoise/lpython/src/runtime/lpython/ python main.py
no_bug works just fine:
3
the_callback fails:
Traceback (most recent call last):
File "/home/emoise/lpython/callback_bug/main.py", line 8, in
from the_callback import entry_point
File "/home/emoise/lpython/callback_bug/the_callback.py", line 8, in
def bar(func : Callable[[i32], i32], arg : i32) -> i32:
File "/home/emoise/lpython/src/runtime/lpython/lpython.py", line 471, in ccall
return CTypes(f)
File "/home/emoise/lpython/src/runtime/lpython/lpython.py", line 371, in init
arg_ctype = convert_type_to_ctype(arg_type)
File "/home/emoise/lpython/src/runtime/lpython/lpython.py", line 294, in convert_type_to_ctype
type = convert_type_to_ctype(arg._type)
File "/home/emoise/lpython/src/runtime/lpython/lpython.py", line 298, in convert_type_to_ctype
elif issubclass(arg, Enum):
TypeError: issubclass() arg 1 must be a class
Activity
ubaidsk commentedon Jul 24, 2023
Sharing the contents of the zip files for easy reference.
no_bug.zipcontents:callback_bug.zipcontents:Smit-create commentedon Jul 24, 2023
The following diff should fix that: