Karthik | Langtrace AIK
Windmillโ€ข2y agoโ€ข
10 replies
Karthik | Langtrace AI

Decorators with def main() not working in python

I am running into the following issue when I use a decorator with def main()

error:
ExecutionErr: error during execution of the script:
Error parsing code: Got unexpected EOF at byte offset 617


Wondering if this is windmill runtime specific config issue? It works well if I use the decorator on any other method and call it inside main.

See below the code:

def my_decorator(func):
    def wrapper():
        print("Something is happening before the function is called.")
        func()
        print("Something is happening after the function is called.")
    return wrapper

@my_decorator
def main():
    print("The main function is running.")
Was this page helpful?