Hi; I'll trouble-shoot bare excepts as I work on new code. I'll trouble-shoot the others that don't (seem to) cause problems later. Here's a new one:
for optionsStore, storeOptions in ourOptions().iteritems(): if store == optionsStore: for option in storeOptions: try: fromForm = form.getfirst(option) try: fromForm, junk = string.split(fromForm, ':') except: pass # This is only an expedient to split options that have a colon in them, such as the colors fromForm = string.replace(fromForm, '-', '') sql = 'select "%s" from %s%s t join %s p where p.ID=t.ID;' % (fromForm, store, (option[0].upper() + option[1:]), store) # print sql cursor.execute(sql) try: optionsPrices += cursor.fetchone()[0] except TypeError: pass # There is no options price for this. except: raise If there are no values entered into table (in this case "productsSizes") for the given product ID, then "optionsPrices" should not be added unto. Am I doing this correctly? Or is there a better way than capturing ALL TypeErrors? TIA, beno
-- http://mail.python.org/mailman/listinfo/python-list