[Zope3-checkins] CVS: Zope3/src/zope/app/services - service.py:1.8.4.6

Guido van Rossum guido@python.org
Mon, 3 Mar 2003 12:04:46 -0500


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv638/src/zope/app/services

Modified Files:
      Tag: use-config-branch
	service.py 
Log Message:
Properly fix the failure of test_addservicecontainer.py.
Turns out that in zope/app/browser/services/service.py, we need to use
self.context.context as the context passed to ServiceConfiguration().

=== Zope3/src/zope/app/services/service.py 1.8.4.5 => 1.8.4.6 ===
--- Zope3/src/zope/app/services/service.py:1.8.4.5	Thu Feb 27 20:43:28 2003
+++ Zope3/src/zope/app/services/service.py	Mon Mar  3 12:04:42 2003
@@ -267,13 +267,7 @@
         if context is not None:
             # Check that the object implements stuff we need
             wrapped_self = ContextWrapper(self, context)
-            # XXX This try/except shouldn't be here; but some tests in
-            # zope.app.browser.services.tests.test_addservicecontainer
-            # fail at this point; I need help to figure out why.
-            try:
-                service = wrapped_self.getComponent()
-            except TypeError:
-                return # Couldn't get the service; assuming it's a test
+            service = wrapped_self.getComponent()
             if not IService.isImplementedBy(service):
                 raise TypeError("service %r doesn't implement IService" %
                                 service)