I'm using a ArcMap script tool to test if a facility is on a list. If it's not on the list, I want to print a statement and exit the script. The script works just fine as a standalone script but it errors out when I turn it into a script tool.
import arcpy, sys FacID_raw = arcpy.GetParameterAsText(0) POT_ID_List = ["AAA", "BBB", "CCC"] for POT in POT_Search_List: POT_ID_List.append(str(POT.getValue("Facility_ID"))) if Fac_ID not in POT_ID_List: print Fac_ID + " not in List. Notify team lead." sys.exit(0)
The error I get is:
<type 'exceptions.SystemExit'>: 0
How do I exit out of a script tool when a condition isn't met?