in
PYL-R1714206 return True
207
208 def client_certificate_callback(self, connection, x509, errno, depth, result):
209 if depth == 0 and (errno == 9 or errno == 10):210 return False # expired / not yet valid
211 if not aj.config.data['ssl']['client_auth']['force']:
212 return True
To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained in
it instead of checking for equality against each of the values.
This is faster, less verbose, and more readable.
if x == 1 or x == 2 or x == 3:
do_something()
if x in (1, 2, 3):
do_something()