findloc is another subroutine i created,when parse is called sometimes it returns None and sometimes a value, when trying to rstrip I am getting the following error?how to use rstrip only when the object is non “nonetype” or please suggest any other method.
build_loc=parse(findloc(targetmeta_cid).strip())
Target_list.append(build_loc.rstrip('\r\n'))
Error
Target_list.append(build_loc.rstrip('\r\n'))AttributeError: 'NoneType' object has no attribute 'rstrip'
You can this
in order to make it work. Hope this helps 🙂