project/format python: trying to fix some error handling cases
project/format python: trying to fix some error handling cases

tscholl2/smc,DrXyzzy/smc,tscholl2/smc,sagemathinc/smc,tscholl2/smc,DrXyzzy/smc,sagemathinc/smc,tscholl2/smc,sagemathinc/smc,DrXyzzy/smc,DrXyzzy/smc,tscholl2/smc,sagemathinc/smc