Change != None to is not None.