I apologize, here is my revised code with corrected indentations.......This script works except when I get to my conditional statement........My goal.....If a featureclass is already unregistered or is not versioned, the script needs to continue to the next featureclass w/o an error
import arcpy
editDB = "Database Connections\\Arden@gsw_sde.sde"
workspace = editDB
arcpy.env.workspace = workspace
datasets = arcpy.ListDatasets("*", "Feature")
print datasets
for dataset in datasets:
fcList = arcpy.ListFeatureClasses("*","",dataset)
for fc in fcList:
#My error begins below...
if fc == 'Versioned':
continue
print fc
arcpy.UnregisterAsVersioned_management(fc,"NO_KEEP_EDIT","COMPRESS_DEFAULT")
arcpy.Compress_management(editDB)
Runtime error Traceback (most recent call last): File "<string>", line 16, in <module> File "d:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 16702, in UnregisterAsVersioned raise e ExecuteError: ERROR 000131: The dataset is not versioned.
>>>