First example - Ok - In this xample it’s displaying errors - OK:
def test():
print(‘function test - line 1’)
msg=MIMEMultipart(‘alternative’)
print(‘function test - line 3’)
print(‘function test - line 4’)
print(‘main code - hi’)
test()
print(‘main code - yeh’)
In the example above, python correctly throw a error - “NameError: name ‘MIMEMultipart’ is not defined” (because in the example I don’t put the import commands in the code)
BUT I have another python code (a bigger code), in which I have built in the same code above , and Python it’s not giving error message.
Python executes just the following lines / output:
‘main code - hi’
‘function test - line 1’
‘main code - yeh’
Until some days ago I could get all Python errors in the screen, but now I have this problem above.
(evertyhing else it’s working in my bigger code)
I am using Python 3.9.4
I tested in another machine, with Python 3.7.4 - the same problem occurs
And tested in a third machine, with python 3.5.9 - the same problem occurs