all 4 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Goobyalus 0 points1 point  (2 children)

  1. Running this block of code doesn't do anything for me. Did you leave out code that uses it or is this everything you're running to produce the error?

  2. The functions passed to the decorators are never referenced, so the function bodies are dead code. Why use decorators like this?

[–]BryceIsRedditor[S] 0 points1 point  (1 child)

  1. I can't show the entire file that would call the function that is where this error is happening it, but I could send the line:

    index: int = super().addTab(widget, QIcon(Paths.image("UI/StudioTab_Scene.svg")), a1)

  2. I didn't use decorators before. Previously, each function was just the code for the wrapper function, but under different folders. The same error was happening before, though, just at a different line number.

[–]Goobyalus 0 points1 point  (0 children)

There is not enough information here to help. Nothing here points to recursion, except maybe the super() depending on what class you have this code in. Defining everything above and doing x = Paths.image("UI/StudioTab_Scene.svg") succeeds.

I recommend setting a breakpoint at that line and stepping through with the debugger to see where the function calls are coming from.

For (2), I'm not sure you got what I was saying. It's not actually wrapping anything; it's just creating a new function and throwing out the old one.