cProfile for Python does not recognize Function name

The problem is that you imported send_email inside your method definition.

I suggest you to use runctx:

cProfile.runctx('send_email()', None, locals())

From the official documentation:

cProfile.runctx(command, globals, locals, filename=None)

This function is similar to run(), with added arguments to supply the globals and locals dictionaries for the command string.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)