Lines Matching refs:exc
169 except Exception as exc:
170 raise RuntimeError('issue29692:Chained') from exc
384 exc = None variable in mycontext
391 def __exit__(self, *exc): argument
392 self.exc = exc
411 self.assertEqual(context.exc, (None, None, None))
420 self.assertIsNotNone(context.exc)
421 self.assertIs(context.exc[0], NameError)
427 self.assertIsNotNone(context.exc)
428 self.assertIs(context.exc[0], NameError)
436 self.assertIsNone(context.exc)
439 self.assertEqual(context.exc, (None, None, None))
447 self.assertIsNone(context.exc)
453 self.assertIsNotNone(context.exc)
454 self.assertIs(context.exc[0], NameError)
491 def __exit__(self, *exc): argument
503 def __uxit__(self, *exc): argument
514 exc = None variable in TestContextDecorator.test_contextdecorator_as_mixin.somecontext
520 def __exit__(self, *exc): argument
521 self.exc = exc
529 self.assertIsNone(context.exc)
532 self.assertEqual(context.exc, (None, None, None))
602 def _expect_exc(exc_type, exc, exc_tb): argument
606 def _expect_ok(exc_type, exc, exc_tb): argument
608 self.assertIsNone(exc)
680 stack.push(lambda *exc: False)
685 stack.push(lambda *exc: True)
692 def __init__(self, exc): argument
693 self.exc = exc
697 raise self.exc
724 except IndexError as exc:
725 self.assertIsInstance(exc.__context__, KeyError)
726 self.assertIsInstance(exc.__context__.__context__, AttributeError)
728 self.assertIsNone(exc.__context__.__context__.__context__)
738 def raise_exc(exc): argument
739 raise exc
755 except IndexError as exc:
756 self.assertIsInstance(exc.__context__, KeyError)
757 self.assertIsInstance(exc.__context__.__context__, AttributeError)
759 self.assertIsNone(exc.__context__.__context__.__context__)
769 def raise_exc(exc): argument
770 raise exc
779 except Exception as exc:
780 self.assertIsInstance(exc, IndexError)
789 except Exception as exc:
790 self.assertIsInstance(exc, KeyError)
797 def gets_the_context_right(exc): argument
801 raise exc
817 except Exception as exc:
818 self.assertIs(exc, exc4)
819 self.assertIs(exc.__context__, exc3)
820 self.assertIs(exc.__context__.__context__, exc2)
821 self.assertIs(exc.__context__.__context__.__context__, exc1)
823 exc.__context__.__context__.__context__.__context__)
843 except Exception as exc:
844 self.assertIs(exc, exc5)
845 self.assertIs(exc.__context__, exc4)
846 self.assertIs(exc.__context__.__context__, exc3)
847 self.assertIs(exc.__context__.__context__.__context__, exc2)
849 exc.__context__.__context__.__context__.__context__, exc1)
851 exc.__context__.__context__.__context__.__context__.__context__)
860 except IndexError as exc:
865 stack.push(lambda *exc: True)
866 stack.push(lambda *exc: 1/0)
867 stack.push(lambda *exc: {}[1])
893 except Exception as exc:
894 raise UniqueException("new exception") from exc
900 except Exception as exc:
901 raise exc
911 exc = err_ctx.exception
912 self.assertIsInstance(exc, UniqueException)
913 self.assertIsInstance(exc.__context__, UniqueRuntimeError)
914 self.assertIsNone(exc.__context__.__context__)
915 self.assertIsNone(exc.__context__.__cause__)
916 self.assertIs(exc.__cause__, exc.__context__)