[python] Fix extern import line generation