AnsweredAssumed Answered

my code fails with "geoprocessing object not iterable" in 9.3 but works in 10

Question asked by turnerkyle on Jun 21, 2012
Latest reply on Jun 22, 2012 by turnerkyle
Can anyone explain why my code fails with "geoprocessing object not iterable" in 9.3 but works in 10. Are there some compatibility issues going on? I wrote the python code in 10 but made sure not to make any calls to arcpy.
I invoked, gp = arcgisscripting.create(9.3)

My understanding is before 9.3, python didn't use 'real' lists, so calling list methods would obviously fail. Is that wrong? Is 9.3 not able to use list methods?

The following code, I believe, is where the problem is...I think??
# function to return appropriate 3.0 feature class for given 2.6 feature class # and it returns the name of the fieldname, FC_26_name def which30(two6ftrcls):      two6FC = two6ftrcls     whereclause = "Two6FCs = '" + two6FC + "'"     gp.AddMessage("whereclause is " +whereclause)     crosswalk = ShellPath + "/Two630FC_IDPKxwalk.dbf"     # The variables row and rows are initially set to None, so that they     #  can be deleted in the finally block regardless of where (or if)     #  script fails.     row, rows = None, None     Three0ftrlst = []     FC_26namelst = []     rows = gp.SearchCursor(crosswalk,whereclause)     row = rows.next()     if (row == None):         gp.AddMessage("check the Two630FC_IDPKxwalk.dbf table for Two6FCs -->" +two6FC)     elif (row != None):        rows = gp.SearchCursor(crosswalk,whereclause)        for row in rows:            if not row.isNull("Three0FCs"):               Three0ftr=row.getValue("Three0FCs")               Three0ftrlst.append(str(Three0ftr))               FC_26name = row.getValue("FC_26")               FC_26namelst.append(str(FC_26name))      if row: del row     if rows: del rows      return Three0ftrlst, FC_26namelst

Outcomes