Before upgrading to 2.9, I never had an issue with my labeling code at all:
def FindLabel([TrailName],[Width]):
str_list = []
if [TrailName] not in (None, "<NULL>","<Null>", "", "0"):
str_list.append([TrailName])
if [Width] not in (None, "<NULL>","<Null>", "", "0", " "):
width_str = '<ITA>Width = {}\'</ITA>'.format("<ITA>" + [Width] + "</ITA>")
str_list.append(width_str)
label_str = '\n'.join(str_list)
return(label_str)
Now that I switched to 2.9, I'm now getting the following error:
Invalid Expression
Traceback (most recent call last):
File "<expression", line 1, in <module>
NameError: name 'FindLabel' is not defined
I have pasted the exact same code into ArcMap 10.8.1 and it works just fine. So I'm very confused why all of a sudden a labeling script I've used for over a year now just fails in Pro?
Any ideas?