py_last_error function

Get or (re)set the last Python error encountered.