170 try:
171 len(value)
172 value.__getitem__
173 except Exception:174 return False
175
176 return True
305 if isinstance(argument, str):
306 try:
307 attr = str(argument)
308 except Exception:309 pass
310 else:
311 try:
117 return native_concat(
118 [n async for n in self.root_render_func(ctx)] # type: ignore
119 )
120 except Exception:121 return self.environment.handle_exception()
122
123
102
103 try:
104 return native_concat(self.root_render_func(ctx)) # type: ignore
105 except Exception:106 return self.environment.handle_exception()
107
108 async def render_async(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
457 if isinstance(argument, str):
458 try:
459 attr = str(argument)
460 except Exception: 461 pass
462 else:
463 try:
If the except block catches a very general exception, it is likely to catch any unrelated errors too. Try to be more explicit about which exception(s) you're trying to catch.
If you need to catch every other exception, then mark it as intentional by
adding a # skipcq
comment.
try:
x = a / b
except Exception:
x = a / (b + 1)
try:
line = input('Enter numbers:')
numbers = [int(i) for i in line.split()]
except BaseException:
print('Only use numbers for the input')
try:
x = a / b
except ZeroDivisionError:
x = a / (b + 1)
try:
event_loop.run()
except Exception as exc: # skipcq: PYL-W0703 - Loop can sometimes crash.
sentry.report(exc)
try:
line = input('Enter numbers:')
numbers = [int(i) for i in line.split()]
except ValueError:
print('Only use numbers for the input')