1. tuck
  2. pyramid_perfstat


tuck  committed f544c19

change multiview test (method provided by zope3 interface)

  • Participants
  • Parent commits 901a9b2
  • Branches 0.2

Comments (0)

Files changed (1)

File pyramid_perfstat/perf_serializer.py

View file
 from pyramid.interfaces import IRouteRequest
 from pyramid.interfaces import IRoutesMapper
 from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import IMultiView
 from pyramid.interfaces import IView
 from pyramid.threadlocal import get_current_request
                 view_callable = registry.adapters.lookup(
                     (IViewClassifier, request_iface, Interface),
                     IView, name='', default=None)
-                if 'MultiView' in str(type(view_callable)):
+                if IMultiView.providedBy(view_callable):
                     view_callable = view_callable.match(None, request) # TODO MultiView.match() expects a context as a first arg. I guess it would be preferrable to provide this information instead of None.
             self.view_name = ".".join((view_callable.__module__,view_callable.__name__))