Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.8 issue #357

Open
ExtraTon618 opened this issue Oct 15, 2024 · 0 comments
Open

Python 3.8 issue #357

ExtraTon618 opened this issue Oct 15, 2024 · 0 comments

Comments

@ExtraTon618
Copy link

The cloned code doesn't compile with Python 3.8. due to the addition of *get_user_... operator on gen_mpy.py. I have changed this to be compatible with previous versions of Python. Please commit this! Thanks a lot !
gen_mpy.patch

diff --git a/gen/gen_mpy.py b/gen/gen_mpy.py
index 23749b7..0b8437e 100644
--- a/gen/gen_mpy.py
+++ b/gen/gen_mpy.py
@@ -1847,8 +1847,6 @@ def get_user_data(func, func_name = None, containing_struct = None, containing_s
if not func_name: func_name = get_arg_name(func.type)
# print('/* --> callback: func_name = %s, args = %s */' % (func_name, repr(args)))
user_data_found = False

  • getter = None
  • setter = None
    user_data = 'None'
    if len(args) > 0 and isinstance(args[0].type, c_ast.PtrDecl):
    # if isinstance(args[0].type.type.type, c_ast.Struct):
    @@ -1881,15 +1879,7 @@ def get_user_data(func, func_name = None, containing_struct = None, containing_s
    containing_struct_j = next((struct for struct in lvgl_json["structures"] if struct["name"] == struct_arg_type_name_with_underscore), None)
    if containing_struct_j is not None:
    user_data_found = any(user_data == field["name"] for field in containing_struct_j["fields"])
  •                getter, setter = get_user_data_accessors(containing_struct, containing_struct_name)
    
  •                 # Ensure that getter and setter are initialized
    
  •                # Ensure that getter and setter are initialized
    
  •                if not getter:
    
  •                   getter = None
    
  •                if not setter:
    
  •                   setter = None
    
  • return (user_data if user_data_found else None), getter, setter
    -# return (user_data if user_data_found else None), *get_user_data_accessors(containing_struct, containing_struct_name)
  • return (user_data if user_data_found else None), *get_user_data_accessors(containing_struct, containing_struct_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant