I get an error when I try to do a simple typecasting from string to integer in python (2.7):
year = device.time[year_pos:].strip() # This is '1993'
t = int(year) # Throws exception: "UnboundLocalError: local variable 'int' referenced before assignment"
Why? :)