I'm having some trouble with this snippet of code:
if not fundbenchmark.endswith(("Index", "INDEX")) and fundbenchmark is not None:
fundbenchmark = "%s%s" % (fundbenchmark, " Index")
Traceback:
AttributeError: 'NoneType' object has no attribute 'endswith'
Apparently this error appears when fundbenchmark
is None
. Implying that there is something wrong with and fundbenchmark is not None:
Am I correct in this assumption or is the explanation to be found elsewhere?