Except block directly handles BaseException.
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
else:
try:
self.cj.set_cookie(dspreauth)
- except:
+ except Exception:
self.set_cookie('DSPREAUTH', dspreauth)
try:
self.cj.set_cookie(dssignin)
- except:
+ except Exception:
self.set_cookie('DSSIGNIN', dssignin)
inner = self.gen_policy_request()
else:
logging.warning('Unknown DN type %s', str(dn_name))
raise Exception()
- except:
+ except Exception:
fail = True
break
if fail:
mac = netifaces.ifaddresses(iface)[netifaces.AF_LINK][0]['addr']
assert mac != '00:00:00:00:00:00'
mac_addrs.append(mac)
- except:
+ except Exception:
pass
hostname = os.environ.get('TNCC_HOSTNAME', socket.gethostname())
try:
if zipfile.ZipFile(self.tncc_jar, 'r').testzip() is not None:
raise Exception()
- except:
+ except Exception:
print('Downloading tncc.jar...')
os.makedirs(os.path.expanduser(TNCC_DIRECTORY), exist_ok=True)
urllib.request.urlretrieve('https://' + self.vpn_host
jar.getinfo(name.replace('.', '/') + '.class')
self.class_name = name
break
- except:
+ except Exception:
pass
else:
raise Exception('Could not find class name for', self.tncc_jar)