[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/pas/pas.py Python style: explicitely return None instead of falling through the end

Florent Guillaume fg at nuxeo.com
Mon Oct 11 07:04:46 EDT 2004


Log message for revision 27960:
  Python style: explicitely return None instead of falling through the end
  of a method.
  


Changed:
  U   Zope3/trunk/src/zope/app/pas/pas.py


-=-
Modified: Zope3/trunk/src/zope/app/pas/pas.py
===================================================================
--- Zope3/trunk/src/zope/app/pas/pas.py	2004-10-11 11:02:57 UTC (rev 27959)
+++ Zope3/trunk/src/zope/app/pas/pas.py	2004-10-11 11:04:45 UTC (rev 27960)
@@ -100,8 +100,8 @@
                 id, info = authenticated
                 return self._create('createAuthenticatedPrincipal',
                                     self.prefix+id, info, request)
+        return None
 
-
     def _create(self, meth, *args):
         # We got some data, lets create a user
         for factory in self.factories:
@@ -135,7 +135,7 @@
         return self._delegate('getPrincipal', self.prefix+id)
 
     def unauthenticatedPrincipal(self):
-        pass
+        return None
 
     def unauthorized(self, id, request):
         protocol = None
@@ -158,8 +158,9 @@
     def _delegate(self, meth, *args):
         # delegate to next AS
         next = queryNextService(self, Authentication, None)
-        if next is not None:
-            return getattr(next, meth)(*args)
+        if next is None:
+            return None
+        return getattr(next, meth)(*args)
 
 
 class LocalPAS(PAS, Persistent, Contained):



More information about the Zope3-Checkins mailing list