solving through python signal call is wrapped in a try-catch block