def check_credentials(self):
if self.username is None or self.password is None:<EOL><INDENT>raise DistlibException('<STR_LIT>')<EOL><DEDENT>pm = HTTPPasswordMgr()<EOL>_, netloc, _, _, _, _ = urlparse(self.url)<EOL>pm.add_password(self.realm, netloc, self.username, self.password)<EOL>self.password_handler = HTTPBasicAuthHandler(pm)<EOL>
Check that ``username`` and ``password`` have been set, and raise an
exception if not.