[Checkins] SVN: zope.app.testing/trunk/src/zope/app/testing/ztapi.py - Change argument variable name as to not conflict with new keyword in Python 2.6

Sidnei da Silva sidnei at enfoldsystems.com
Mon Oct 13 13:53:41 EDT 2008


Log message for revision 92127:
   - Change argument variable name as to not conflict with new keyword in Python 2.6

Changed:
  U   zope.app.testing/trunk/src/zope/app/testing/ztapi.py

-=-
Modified: zope.app.testing/trunk/src/zope/app/testing/ztapi.py
===================================================================
--- zope.app.testing/trunk/src/zope/app/testing/ztapi.py	2008-10-13 17:08:15 UTC (rev 92126)
+++ zope.app.testing/trunk/src/zope/app/testing/ztapi.py	2008-10-13 17:53:40 UTC (rev 92127)
@@ -62,13 +62,15 @@
     gsm.registerAdapter(name, (for_, layer), IDefaultViewName, '')
 
 stypes = list, tuple
-def provideAdapter(required, provided, factory, name='', with=()):
+def provideAdapter(required, provided, factory, name='', with_=(), **kw):
+    if with_ is None and kw.has_key('with'):
+        with_ = kw['with']
     if isinstance(factory, (list, tuple)):
         raise ValueError("Factory cannot be a list or tuple")
     gsm = zope.component.getGlobalSiteManager()
 
-    if with:
-        required = (required, ) + tuple(with)
+    if with_:
+        required = (required, ) + tuple(with_)
     elif not isinstance(required, stypes):
         required = (required,)
 



More information about the Checkins mailing list