find - Use `getattr` instead of `__getattribute__` (#78503)

pull/78518/head
Matt Clay 3 years ago committed by GitHub
parent 3a666a131f
commit 9eb3d6811b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -291,9 +291,9 @@ def agefilter(st, now, age, timestamp):
'''filter files older than age'''
if age is None:
return True
elif age >= 0 and now - st.__getattribute__("st_%s" % timestamp) >= abs(age):
elif age >= 0 and now - getattr(st, "st_%s" % timestamp) >= abs(age):
return True
elif age < 0 and now - st.__getattribute__("st_%s" % timestamp) <= abs(age):
elif age < 0 and now - getattr(st, "st_%s" % timestamp) <= abs(age):
return True
return False

Loading…
Cancel
Save