I manage to use the following code to catch the http error code 409 so that the script won't exit. I hope that it is the appropriate way to handle.
So, the remaining question is whether a non-member can be removed as we do not want the remaining non-member setting affect member setting if such a member is removed using the web UI.
try: imported = my_list.subscribe(nonmember.email, 'Import from nonmember', pre_verified=True, pre_confirmed=True, pre_approved=True) importedmember = my_list.get_member(nonmember.email) print ("Importing " + nonmember.email) importedmember.moderation_action = nonmember.moderation_action importedmember.save() prefs = importedmember.preferences prefs['delivery_status'] = 'by_user' prefs.save() except HTTPError as e: if (e.code == 409): print ("Already imported " + nonmember.email) else: raise