python: Handle errors when loading chained modules more properly.