Update runKeyGen.py

added an exception handler to solve the TypeError problem.