cleanup
Replace python 'warn' with custom function

Sometimes 'warn' hanged application. Problem
reported by Philippe Esperet, and confirmed
on my machine.