Lines Matching refs:exc
168 except Exception as exc:
169 raise RuntimeError('issue29692:Chained') from exc
383 exc = None variable in mycontext
390 def __exit__(self, *exc): argument
391 self.exc = exc
410 self.assertEqual(context.exc, (None, None, None))
419 self.assertIsNotNone(context.exc)
420 self.assertIs(context.exc[0], NameError)
426 self.assertIsNotNone(context.exc)
427 self.assertIs(context.exc[0], NameError)
435 self.assertIsNone(context.exc)
438 self.assertEqual(context.exc, (None, None, None))
446 self.assertIsNone(context.exc)
452 self.assertIsNotNone(context.exc)
453 self.assertIs(context.exc[0], NameError)
490 def __exit__(self, *exc): argument
502 def __uxit__(self, *exc): argument
513 exc = None variable in TestContextDecorator.test_contextdecorator_as_mixin.somecontext
519 def __exit__(self, *exc): argument
520 self.exc = exc
528 self.assertIsNone(context.exc)
531 self.assertEqual(context.exc, (None, None, None))
612 def _expect_exc(exc_type, exc, exc_tb): argument
616 def _expect_ok(exc_type, exc, exc_tb): argument
618 self.assertIsNone(exc)
690 stack.push(lambda *exc: False)
695 stack.push(lambda *exc: True)
702 def __init__(self, exc): argument
703 self.exc = exc
707 raise self.exc
734 except IndexError as exc:
735 self.assertIsInstance(exc.__context__, KeyError)
736 self.assertIsInstance(exc.__context__.__context__, AttributeError)
738 self.assertIsNone(exc.__context__.__context__.__context__)
748 def raise_exc(exc): argument
749 raise exc
765 except IndexError as exc:
766 self.assertIsInstance(exc.__context__, KeyError)
767 self.assertIsInstance(exc.__context__.__context__, AttributeError)
769 self.assertIsNone(exc.__context__.__context__.__context__)
779 def raise_exc(exc): argument
780 raise exc
789 except Exception as exc:
790 self.assertIsInstance(exc, IndexError)
799 except Exception as exc:
800 self.assertIsInstance(exc, KeyError)
807 def gets_the_context_right(exc): argument
811 raise exc
827 except Exception as exc:
828 self.assertIs(exc, exc4)
829 self.assertIs(exc.__context__, exc3)
830 self.assertIs(exc.__context__.__context__, exc2)
831 self.assertIs(exc.__context__.__context__.__context__, exc1)
833 exc.__context__.__context__.__context__.__context__)
853 except Exception as exc:
854 self.assertIs(exc, exc5)
855 self.assertIs(exc.__context__, exc4)
856 self.assertIs(exc.__context__.__context__, exc3)
857 self.assertIs(exc.__context__.__context__.__context__, exc2)
859 exc.__context__.__context__.__context__.__context__, exc1)
861 exc.__context__.__context__.__context__.__context__.__context__)
870 except IndexError as exc:
875 stack.push(lambda *exc: True)
876 stack.push(lambda *exc: 1/0)
877 stack.push(lambda *exc: {}[1])
903 except Exception as exc:
904 raise UniqueException("new exception") from exc
910 except Exception as exc:
911 raise exc
921 exc = err_ctx.exception
922 self.assertIsInstance(exc, UniqueException)
923 self.assertIsInstance(exc.__context__, UniqueRuntimeError)
924 self.assertIsNone(exc.__context__.__context__)
925 self.assertIsNone(exc.__context__.__cause__)
926 self.assertIs(exc.__cause__, exc.__context__)