Commit b457ffc5 authored by Patrick Gerken's avatar Patrick Gerken

Better check of "in" support

To be sure that "in" is supported
I'd have to check for multiple possible
builtin attributes. Instead I do a try 
except.
parent 6a67376b
......@@ -541,9 +541,12 @@ class BaseRequest:
hasattr(parents[1], 'aq_base') and
not hasattr(parents[1],'__bobo_traverse__')):
base = parents[1].aq_base
if not (hasattr(base, entry_name) or entry_name in base
(hasattr(base, '__iter__') and entry_name in base)):
raise AttributeError(entry_name)
if not hasattr(base, entry_name):
try:
if not entry_name in base:
raise AttributeError(entry_name)
except TypeError:
raise AttributeError(entry_name)
# After traversal post traversal hooks aren't available anymore
del self._post_traverse
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment