Check exception in python binding.