fixes issue 1980

pyflaked the module, at least a bit. Sometimes I feel developers are in a contest
where less characters and lines win. Concise implementation wins over verbose one,
but less SLOC DON'T mean somewhat better code. Just reading through
this module makes my brain hurt a bit
Merge pull request #512 from niphlod/issue/1980

fixes issue 1980