Guys, after trying the solution of @Yoriz i.e. this:
print(1 == 2) if 1 == 2: print("[...]") print("Ended")The code works properly, which is wired because only adding the last print("Ended") part changes the behavior (i.e. the if statement gets not executed). This does not make any sense to me.