Add global keyword for the exit_code variable
Merge pull request #802 from marco-c/fix_runtests

Add global keyword for the exit_code variable