if isinstance(argument, basestring):
try:
attr = str(argument)
- except:
+ except Exception:
pass
else:
try:
vars = dict(*args, **kwargs)
try:
return concat(self.root_render_func(self.new_context(vars)))
- except:
+ except Exception:
exc_info = sys.exc_info()
return self.environment.handle_exception(exc_info, True)
try:
for event in self.root_render_func(self.new_context(vars)):
yield event
- except:
+ except Exception:
exc_info = sys.exc_info()
else:
return
f = _binop_to_func[self.operator]
try:
return f(self.left.as_const(eval_ctx), self.right.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
f = _uaop_to_func[self.operator]
try:
return f(self.node.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
if self.dyn_args is not None:
try:
args.extend(self.dyn_args.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
if self.dyn_kwargs is not None:
try:
kwargs.update(self.dyn_kwargs.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
try:
return filter_(obj, *args, **kwargs)
- except:
+ except Exception:
raise Impossible()
if self.dyn_args is not None:
try:
args.extend(self.dyn_args.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
if self.dyn_kwargs is not None:
try:
kwargs.update(self.dyn_kwargs.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
try:
return obj(*args, **kwargs)
- except:
+ except Exception:
raise Impossible()
try:
return self.environment.getitem(self.node.as_const(eval_ctx),
self.arg.as_const(eval_ctx))
- except:
+ except Exception:
raise Impossible()
def can_assign(self):
eval_ctx = get_eval_context(self, eval_ctx)
return self.environment.getattr(self.node.as_const(eval_ctx),
self.attr)
- except:
+ except Exception:
raise Impossible()
def can_assign(self):
new_value = op.expr.as_const(eval_ctx)
result = _cmpop_to_func[op.op](value, new_value)
value = new_value
- except:
+ except Exception:
raise Impossible()
return result
def concat(gen):
try:
return _concat(list(gen))
- except:
+ except Exception:
# this hack is needed so that the current frame
# does not show up in the traceback.
exc_type, exc_value, tb = sys.exc_info()