r47038 - some more cleanups

hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Sun, 20 Mar 2016 19:22:38 -0600 (MDT)
Newsgroups gmane.comp.python.twisted.commits
Message-ID <[email protected]>
Author: hawkowl
Date: Sun Mar 20 19:22:35 2016
New Revision: 47038

Modified:
   branches/clarity-sshuserauth-8240/twisted/conch/ssh/userauth.py

Log:
some more cleanups

Modified: branches/clarity-sshuserauth-8240/twisted/conch/ssh/userauth.py
==============================================================================
--- branches/clarity-sshuserauth-8240/twisted/conch/ssh/userauth.py	(original)
+++ branches/clarity-sshuserauth-8240/twisted/conch/ssh/userauth.py	Sun Mar 20 19:22:35 2016
@@ -66,7 +66,6 @@
     @ivar clock: an object with a callLater method.  Stubbed out for testing.
     """
 
-
     name = 'ssh-userauth'
     loginTimeout = 10 * 60 * 60
     # 10 minutes before we disconnect them
@@ -148,7 +147,7 @@
             return defer.fail(
                     error.ConchError('unsupported authentication, failing'))
         kind = kind.replace(b'-', b'_')
-        f = getattr(self, 'auth_%s' % kind, None)
+        f = getattr(self, 'auth_%s' % (kind,), None)
         if f:
             ret = f(data)
             if not ret:
@@ -158,7 +157,7 @@
                             % (kind, )))
             else:
                 return ret
-        return defer.fail(error.ConchError('bad auth type: %s' % kind))
+        return defer.fail(error.ConchError('bad auth type: %s' % (kind,)))
 
 
     def ssh_USERAUTH_REQUEST(self, packet):
@@ -340,7 +339,6 @@
     @type lastPublicKey: L{Key}
     """
 
-
     name = 'ssh-userauth'
     preferredOrder = [b'publickey', b'password', b'keyboard-interactive']