Looks like that line is the line that actually exports the file. Are you in a student version of Maya? The prompt flag on that line is set to false, which may be erroring out if using a student maya version.
If you turn on the stack trace in the script editor, what is the full error?