def _handleattrhelper(Class, transport, methodName):
 method = getattr(transport.getHandle(), ('get_%s_certificate' % (methodName,)), None)
 if (method is None):
  raise CertificateError(('non-TLS transport %r did not have %s certificate' % (transport, methodName)))
 cert = method()
 if (cert is None):
  raise CertificateError(('TLS transport %r did not have %s certificate' % (transport, methodName)))
 return Class(cert)

def _handleattrhelper ( Class , transport , methodName ) : method = getattr ( transport . getHandle ( ) , ( 'get_%s_certificate' % ( methodName , ) ) , None ) if ( method is None ) : raise CertificateError ( ( 'non-TLS transport %r did not have %s certificate' % ( transport , methodName ) ) ) cert = method ( ) if ( cert is None ) : raise CertificateError ( ( 'TLS transport %r did not have %s certificate' % ( transport , methodName ) ) ) return Class ( cert )
helper for l{certificate .