File: builtin_exceptions.py

package info (click to toggle)
cython 3.1.6%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,932 kB
  • sloc: python: 92,172; ansic: 19,275; cpp: 1,407; xml: 1,031; javascript: 511; makefile: 373; sh: 223; sed: 11
file content (1318 lines) | stat: -rw-r--r-- 64,775 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
# mode: run
# tag: exception


# This test file is generated based on the known builtin exceptions.
# To regenerate the tests from a newer Python version, run the file:
#
#    python3 tests/run/builtin_exceptions.py


NEWER_EXCEPTIONS = {
    # Remove when increasing minimal supported Python version.
    'PythonFinalizationError': (3, 10),
    'EncodingWarning': (3, 10),
    'ExceptionGroup': (3, 11),
    'BaseExceptionGroup': (3, 11),
}

CALL_ARGS = {
    'UnicodeError'
}


def gen_tests():
    import builtins
    import sys
    from collections import defaultdict

    with open(__file__, encoding='utf8') as test_file:
        test_code = test_file.readlines()

    # Note: the following strings must not contain the marker lines!
    original_end_code = test_code[test_code.index("##### " + "END GENERATED TESTS\n"):]
    del test_code[test_code.index("##### " + "BEGIN GENERATED TESTS\n") + 1:]

    test_code.append(f"# generated from the builtin exceptions in Python {tuple(sys.version_info)}\n")

    # Construct the list of all exception subtypes.
    subclasses = defaultdict(list)
    for exc_name, exc_type in vars(builtins).items():
        if exc_name.startswith('_'):
            continue
        if not isinstance(exc_type, type) or not issubclass(exc_type, BaseException):
            continue
        if exc_name in NEWER_EXCEPTIONS:
            # Ignore recent exceptions for now.
            continue

        try:
            exc_type("message")
        except TypeError:
            # Needs arguments - ignore.
            continue
        for base_type in exc_type.__mro__:
            subclasses[base_type.__name__].append(exc_name)
            if base_type.__name__ == 'BaseException':
                break

    # Generate tests that pass all subtypes into a typed base type argument.
    for exc_name, subclass_names in sorted(subclasses.items()):
        test_code.append("\n")
        test_code.append(f"def accept_{exc_name}(exc: {exc_name}):\n")

        func_code = []
        func_code.append('"""')
        for subclass_name in subclass_names:
            func_code.append(f">>> accept_{exc_name}({subclass_name}('message'))")
            func_code.append(f">>> class MyExceptionSubtype_{subclass_name}({subclass_name}): pass")
            func_code.append(f">>> accept_{exc_name}(MyExceptionSubtype_{subclass_name}('message'))")
        func_code.append('"""')
        func_code.append(f"exc_var: {exc_name} = {{exc}}.pop()")  # untype the RHS
        func_code.append(f"assert isinstance(exc, BaseException)")
        func_code.append(f"assert {exc_name} in type(exc).__mro__")
        func_code.append(f"assert isinstance(exc, {exc_name})")
        func_code.append(f"assert exc.args == ('message',)")

        # indent and insert test function body
        test_code.extend(f"    {line}\n" for line in func_code)

    test_code.append("\n")
    test_code += original_end_code
    test_code_str = ''.join(test_code)

    with open(__file__, encoding='utf8', mode='w') as test_file:
        test_file.write(test_code_str)

##### BEGIN GENERATED TESTS
# generated from the builtin exceptions in Python (3, 15, 0, 'alpha', 0)

def accept_ArithmeticError(exc: ArithmeticError):
    """
    >>> accept_ArithmeticError(ArithmeticError('message'))
    >>> class MyExceptionSubtype_ArithmeticError(ArithmeticError): pass
    >>> accept_ArithmeticError(MyExceptionSubtype_ArithmeticError('message'))
    >>> accept_ArithmeticError(FloatingPointError('message'))
    >>> class MyExceptionSubtype_FloatingPointError(FloatingPointError): pass
    >>> accept_ArithmeticError(MyExceptionSubtype_FloatingPointError('message'))
    >>> accept_ArithmeticError(OverflowError('message'))
    >>> class MyExceptionSubtype_OverflowError(OverflowError): pass
    >>> accept_ArithmeticError(MyExceptionSubtype_OverflowError('message'))
    >>> accept_ArithmeticError(ZeroDivisionError('message'))
    >>> class MyExceptionSubtype_ZeroDivisionError(ZeroDivisionError): pass
    >>> accept_ArithmeticError(MyExceptionSubtype_ZeroDivisionError('message'))
    """
    exc_var: ArithmeticError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ArithmeticError in type(exc).__mro__
    assert isinstance(exc, ArithmeticError)
    assert exc.args == ('message',)

def accept_AssertionError(exc: AssertionError):
    """
    >>> accept_AssertionError(AssertionError('message'))
    >>> class MyExceptionSubtype_AssertionError(AssertionError): pass
    >>> accept_AssertionError(MyExceptionSubtype_AssertionError('message'))
    """
    exc_var: AssertionError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert AssertionError in type(exc).__mro__
    assert isinstance(exc, AssertionError)
    assert exc.args == ('message',)

def accept_AttributeError(exc: AttributeError):
    """
    >>> accept_AttributeError(AttributeError('message'))
    >>> class MyExceptionSubtype_AttributeError(AttributeError): pass
    >>> accept_AttributeError(MyExceptionSubtype_AttributeError('message'))
    """
    exc_var: AttributeError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert AttributeError in type(exc).__mro__
    assert isinstance(exc, AttributeError)
    assert exc.args == ('message',)

def accept_BaseException(exc: BaseException):
    """
    >>> accept_BaseException(BaseException('message'))
    >>> class MyExceptionSubtype_BaseException(BaseException): pass
    >>> accept_BaseException(MyExceptionSubtype_BaseException('message'))
    >>> accept_BaseException(Exception('message'))
    >>> class MyExceptionSubtype_Exception(Exception): pass
    >>> accept_BaseException(MyExceptionSubtype_Exception('message'))
    >>> accept_BaseException(GeneratorExit('message'))
    >>> class MyExceptionSubtype_GeneratorExit(GeneratorExit): pass
    >>> accept_BaseException(MyExceptionSubtype_GeneratorExit('message'))
    >>> accept_BaseException(KeyboardInterrupt('message'))
    >>> class MyExceptionSubtype_KeyboardInterrupt(KeyboardInterrupt): pass
    >>> accept_BaseException(MyExceptionSubtype_KeyboardInterrupt('message'))
    >>> accept_BaseException(SystemExit('message'))
    >>> class MyExceptionSubtype_SystemExit(SystemExit): pass
    >>> accept_BaseException(MyExceptionSubtype_SystemExit('message'))
    >>> accept_BaseException(ArithmeticError('message'))
    >>> class MyExceptionSubtype_ArithmeticError(ArithmeticError): pass
    >>> accept_BaseException(MyExceptionSubtype_ArithmeticError('message'))
    >>> accept_BaseException(AssertionError('message'))
    >>> class MyExceptionSubtype_AssertionError(AssertionError): pass
    >>> accept_BaseException(MyExceptionSubtype_AssertionError('message'))
    >>> accept_BaseException(AttributeError('message'))
    >>> class MyExceptionSubtype_AttributeError(AttributeError): pass
    >>> accept_BaseException(MyExceptionSubtype_AttributeError('message'))
    >>> accept_BaseException(BufferError('message'))
    >>> class MyExceptionSubtype_BufferError(BufferError): pass
    >>> accept_BaseException(MyExceptionSubtype_BufferError('message'))
    >>> accept_BaseException(EOFError('message'))
    >>> class MyExceptionSubtype_EOFError(EOFError): pass
    >>> accept_BaseException(MyExceptionSubtype_EOFError('message'))
    >>> accept_BaseException(ImportError('message'))
    >>> class MyExceptionSubtype_ImportError(ImportError): pass
    >>> accept_BaseException(MyExceptionSubtype_ImportError('message'))
    >>> accept_BaseException(LookupError('message'))
    >>> class MyExceptionSubtype_LookupError(LookupError): pass
    >>> accept_BaseException(MyExceptionSubtype_LookupError('message'))
    >>> accept_BaseException(MemoryError('message'))
    >>> class MyExceptionSubtype_MemoryError(MemoryError): pass
    >>> accept_BaseException(MyExceptionSubtype_MemoryError('message'))
    >>> accept_BaseException(NameError('message'))
    >>> class MyExceptionSubtype_NameError(NameError): pass
    >>> accept_BaseException(MyExceptionSubtype_NameError('message'))
    >>> accept_BaseException(OSError('message'))
    >>> class MyExceptionSubtype_OSError(OSError): pass
    >>> accept_BaseException(MyExceptionSubtype_OSError('message'))
    >>> accept_BaseException(ReferenceError('message'))
    >>> class MyExceptionSubtype_ReferenceError(ReferenceError): pass
    >>> accept_BaseException(MyExceptionSubtype_ReferenceError('message'))
    >>> accept_BaseException(RuntimeError('message'))
    >>> class MyExceptionSubtype_RuntimeError(RuntimeError): pass
    >>> accept_BaseException(MyExceptionSubtype_RuntimeError('message'))
    >>> accept_BaseException(StopAsyncIteration('message'))
    >>> class MyExceptionSubtype_StopAsyncIteration(StopAsyncIteration): pass
    >>> accept_BaseException(MyExceptionSubtype_StopAsyncIteration('message'))
    >>> accept_BaseException(StopIteration('message'))
    >>> class MyExceptionSubtype_StopIteration(StopIteration): pass
    >>> accept_BaseException(MyExceptionSubtype_StopIteration('message'))
    >>> accept_BaseException(SyntaxError('message'))
    >>> class MyExceptionSubtype_SyntaxError(SyntaxError): pass
    >>> accept_BaseException(MyExceptionSubtype_SyntaxError('message'))
    >>> accept_BaseException(SystemError('message'))
    >>> class MyExceptionSubtype_SystemError(SystemError): pass
    >>> accept_BaseException(MyExceptionSubtype_SystemError('message'))
    >>> accept_BaseException(TypeError('message'))
    >>> class MyExceptionSubtype_TypeError(TypeError): pass
    >>> accept_BaseException(MyExceptionSubtype_TypeError('message'))
    >>> accept_BaseException(ValueError('message'))
    >>> class MyExceptionSubtype_ValueError(ValueError): pass
    >>> accept_BaseException(MyExceptionSubtype_ValueError('message'))
    >>> accept_BaseException(Warning('message'))
    >>> class MyExceptionSubtype_Warning(Warning): pass
    >>> accept_BaseException(MyExceptionSubtype_Warning('message'))
    >>> accept_BaseException(FloatingPointError('message'))
    >>> class MyExceptionSubtype_FloatingPointError(FloatingPointError): pass
    >>> accept_BaseException(MyExceptionSubtype_FloatingPointError('message'))
    >>> accept_BaseException(OverflowError('message'))
    >>> class MyExceptionSubtype_OverflowError(OverflowError): pass
    >>> accept_BaseException(MyExceptionSubtype_OverflowError('message'))
    >>> accept_BaseException(ZeroDivisionError('message'))
    >>> class MyExceptionSubtype_ZeroDivisionError(ZeroDivisionError): pass
    >>> accept_BaseException(MyExceptionSubtype_ZeroDivisionError('message'))
    >>> accept_BaseException(BytesWarning('message'))
    >>> class MyExceptionSubtype_BytesWarning(BytesWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_BytesWarning('message'))
    >>> accept_BaseException(DeprecationWarning('message'))
    >>> class MyExceptionSubtype_DeprecationWarning(DeprecationWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_DeprecationWarning('message'))
    >>> accept_BaseException(FutureWarning('message'))
    >>> class MyExceptionSubtype_FutureWarning(FutureWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_FutureWarning('message'))
    >>> accept_BaseException(ImportWarning('message'))
    >>> class MyExceptionSubtype_ImportWarning(ImportWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_ImportWarning('message'))
    >>> accept_BaseException(PendingDeprecationWarning('message'))
    >>> class MyExceptionSubtype_PendingDeprecationWarning(PendingDeprecationWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_PendingDeprecationWarning('message'))
    >>> accept_BaseException(ResourceWarning('message'))
    >>> class MyExceptionSubtype_ResourceWarning(ResourceWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_ResourceWarning('message'))
    >>> accept_BaseException(RuntimeWarning('message'))
    >>> class MyExceptionSubtype_RuntimeWarning(RuntimeWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_RuntimeWarning('message'))
    >>> accept_BaseException(SyntaxWarning('message'))
    >>> class MyExceptionSubtype_SyntaxWarning(SyntaxWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_SyntaxWarning('message'))
    >>> accept_BaseException(UnicodeWarning('message'))
    >>> class MyExceptionSubtype_UnicodeWarning(UnicodeWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_UnicodeWarning('message'))
    >>> accept_BaseException(UserWarning('message'))
    >>> class MyExceptionSubtype_UserWarning(UserWarning): pass
    >>> accept_BaseException(MyExceptionSubtype_UserWarning('message'))
    >>> accept_BaseException(BlockingIOError('message'))
    >>> class MyExceptionSubtype_BlockingIOError(BlockingIOError): pass
    >>> accept_BaseException(MyExceptionSubtype_BlockingIOError('message'))
    >>> accept_BaseException(ChildProcessError('message'))
    >>> class MyExceptionSubtype_ChildProcessError(ChildProcessError): pass
    >>> accept_BaseException(MyExceptionSubtype_ChildProcessError('message'))
    >>> accept_BaseException(ConnectionError('message'))
    >>> class MyExceptionSubtype_ConnectionError(ConnectionError): pass
    >>> accept_BaseException(MyExceptionSubtype_ConnectionError('message'))
    >>> accept_BaseException(FileExistsError('message'))
    >>> class MyExceptionSubtype_FileExistsError(FileExistsError): pass
    >>> accept_BaseException(MyExceptionSubtype_FileExistsError('message'))
    >>> accept_BaseException(FileNotFoundError('message'))
    >>> class MyExceptionSubtype_FileNotFoundError(FileNotFoundError): pass
    >>> accept_BaseException(MyExceptionSubtype_FileNotFoundError('message'))
    >>> accept_BaseException(InterruptedError('message'))
    >>> class MyExceptionSubtype_InterruptedError(InterruptedError): pass
    >>> accept_BaseException(MyExceptionSubtype_InterruptedError('message'))
    >>> accept_BaseException(IsADirectoryError('message'))
    >>> class MyExceptionSubtype_IsADirectoryError(IsADirectoryError): pass
    >>> accept_BaseException(MyExceptionSubtype_IsADirectoryError('message'))
    >>> accept_BaseException(NotADirectoryError('message'))
    >>> class MyExceptionSubtype_NotADirectoryError(NotADirectoryError): pass
    >>> accept_BaseException(MyExceptionSubtype_NotADirectoryError('message'))
    >>> accept_BaseException(PermissionError('message'))
    >>> class MyExceptionSubtype_PermissionError(PermissionError): pass
    >>> accept_BaseException(MyExceptionSubtype_PermissionError('message'))
    >>> accept_BaseException(ProcessLookupError('message'))
    >>> class MyExceptionSubtype_ProcessLookupError(ProcessLookupError): pass
    >>> accept_BaseException(MyExceptionSubtype_ProcessLookupError('message'))
    >>> accept_BaseException(TimeoutError('message'))
    >>> class MyExceptionSubtype_TimeoutError(TimeoutError): pass
    >>> accept_BaseException(MyExceptionSubtype_TimeoutError('message'))
    >>> accept_BaseException(IndentationError('message'))
    >>> class MyExceptionSubtype_IndentationError(IndentationError): pass
    >>> accept_BaseException(MyExceptionSubtype_IndentationError('message'))
    >>> accept_BaseException(IndexError('message'))
    >>> class MyExceptionSubtype_IndexError(IndexError): pass
    >>> accept_BaseException(MyExceptionSubtype_IndexError('message'))
    >>> accept_BaseException(KeyError('message'))
    >>> class MyExceptionSubtype_KeyError(KeyError): pass
    >>> accept_BaseException(MyExceptionSubtype_KeyError('message'))
    >>> accept_BaseException(ModuleNotFoundError('message'))
    >>> class MyExceptionSubtype_ModuleNotFoundError(ModuleNotFoundError): pass
    >>> accept_BaseException(MyExceptionSubtype_ModuleNotFoundError('message'))
    >>> accept_BaseException(NotImplementedError('message'))
    >>> class MyExceptionSubtype_NotImplementedError(NotImplementedError): pass
    >>> accept_BaseException(MyExceptionSubtype_NotImplementedError('message'))
    >>> accept_BaseException(RecursionError('message'))
    >>> class MyExceptionSubtype_RecursionError(RecursionError): pass
    >>> accept_BaseException(MyExceptionSubtype_RecursionError('message'))
    >>> accept_BaseException(UnboundLocalError('message'))
    >>> class MyExceptionSubtype_UnboundLocalError(UnboundLocalError): pass
    >>> accept_BaseException(MyExceptionSubtype_UnboundLocalError('message'))
    >>> accept_BaseException(UnicodeError('message'))
    >>> class MyExceptionSubtype_UnicodeError(UnicodeError): pass
    >>> accept_BaseException(MyExceptionSubtype_UnicodeError('message'))
    >>> accept_BaseException(BrokenPipeError('message'))
    >>> class MyExceptionSubtype_BrokenPipeError(BrokenPipeError): pass
    >>> accept_BaseException(MyExceptionSubtype_BrokenPipeError('message'))
    >>> accept_BaseException(ConnectionAbortedError('message'))
    >>> class MyExceptionSubtype_ConnectionAbortedError(ConnectionAbortedError): pass
    >>> accept_BaseException(MyExceptionSubtype_ConnectionAbortedError('message'))
    >>> accept_BaseException(ConnectionRefusedError('message'))
    >>> class MyExceptionSubtype_ConnectionRefusedError(ConnectionRefusedError): pass
    >>> accept_BaseException(MyExceptionSubtype_ConnectionRefusedError('message'))
    >>> accept_BaseException(ConnectionResetError('message'))
    >>> class MyExceptionSubtype_ConnectionResetError(ConnectionResetError): pass
    >>> accept_BaseException(MyExceptionSubtype_ConnectionResetError('message'))
    >>> accept_BaseException(TabError('message'))
    >>> class MyExceptionSubtype_TabError(TabError): pass
    >>> accept_BaseException(MyExceptionSubtype_TabError('message'))
    >>> accept_BaseException(EnvironmentError('message'))
    >>> class MyExceptionSubtype_EnvironmentError(EnvironmentError): pass
    >>> accept_BaseException(MyExceptionSubtype_EnvironmentError('message'))
    >>> accept_BaseException(IOError('message'))
    >>> class MyExceptionSubtype_IOError(IOError): pass
    >>> accept_BaseException(MyExceptionSubtype_IOError('message'))
    """
    exc_var: BaseException = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert BaseException in type(exc).__mro__
    assert isinstance(exc, BaseException)
    assert exc.args == ('message',)

def accept_BlockingIOError(exc: BlockingIOError):
    """
    >>> accept_BlockingIOError(BlockingIOError('message'))
    >>> class MyExceptionSubtype_BlockingIOError(BlockingIOError): pass
    >>> accept_BlockingIOError(MyExceptionSubtype_BlockingIOError('message'))
    """
    exc_var: BlockingIOError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert BlockingIOError in type(exc).__mro__
    assert isinstance(exc, BlockingIOError)
    assert exc.args == ('message',)

def accept_BrokenPipeError(exc: BrokenPipeError):
    """
    >>> accept_BrokenPipeError(BrokenPipeError('message'))
    >>> class MyExceptionSubtype_BrokenPipeError(BrokenPipeError): pass
    >>> accept_BrokenPipeError(MyExceptionSubtype_BrokenPipeError('message'))
    """
    exc_var: BrokenPipeError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert BrokenPipeError in type(exc).__mro__
    assert isinstance(exc, BrokenPipeError)
    assert exc.args == ('message',)

def accept_BufferError(exc: BufferError):
    """
    >>> accept_BufferError(BufferError('message'))
    >>> class MyExceptionSubtype_BufferError(BufferError): pass
    >>> accept_BufferError(MyExceptionSubtype_BufferError('message'))
    """
    exc_var: BufferError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert BufferError in type(exc).__mro__
    assert isinstance(exc, BufferError)
    assert exc.args == ('message',)

def accept_BytesWarning(exc: BytesWarning):
    """
    >>> accept_BytesWarning(BytesWarning('message'))
    >>> class MyExceptionSubtype_BytesWarning(BytesWarning): pass
    >>> accept_BytesWarning(MyExceptionSubtype_BytesWarning('message'))
    """
    exc_var: BytesWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert BytesWarning in type(exc).__mro__
    assert isinstance(exc, BytesWarning)
    assert exc.args == ('message',)

def accept_ChildProcessError(exc: ChildProcessError):
    """
    >>> accept_ChildProcessError(ChildProcessError('message'))
    >>> class MyExceptionSubtype_ChildProcessError(ChildProcessError): pass
    >>> accept_ChildProcessError(MyExceptionSubtype_ChildProcessError('message'))
    """
    exc_var: ChildProcessError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ChildProcessError in type(exc).__mro__
    assert isinstance(exc, ChildProcessError)
    assert exc.args == ('message',)

def accept_ConnectionAbortedError(exc: ConnectionAbortedError):
    """
    >>> accept_ConnectionAbortedError(ConnectionAbortedError('message'))
    >>> class MyExceptionSubtype_ConnectionAbortedError(ConnectionAbortedError): pass
    >>> accept_ConnectionAbortedError(MyExceptionSubtype_ConnectionAbortedError('message'))
    """
    exc_var: ConnectionAbortedError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ConnectionAbortedError in type(exc).__mro__
    assert isinstance(exc, ConnectionAbortedError)
    assert exc.args == ('message',)

def accept_ConnectionError(exc: ConnectionError):
    """
    >>> accept_ConnectionError(ConnectionError('message'))
    >>> class MyExceptionSubtype_ConnectionError(ConnectionError): pass
    >>> accept_ConnectionError(MyExceptionSubtype_ConnectionError('message'))
    >>> accept_ConnectionError(BrokenPipeError('message'))
    >>> class MyExceptionSubtype_BrokenPipeError(BrokenPipeError): pass
    >>> accept_ConnectionError(MyExceptionSubtype_BrokenPipeError('message'))
    >>> accept_ConnectionError(ConnectionAbortedError('message'))
    >>> class MyExceptionSubtype_ConnectionAbortedError(ConnectionAbortedError): pass
    >>> accept_ConnectionError(MyExceptionSubtype_ConnectionAbortedError('message'))
    >>> accept_ConnectionError(ConnectionRefusedError('message'))
    >>> class MyExceptionSubtype_ConnectionRefusedError(ConnectionRefusedError): pass
    >>> accept_ConnectionError(MyExceptionSubtype_ConnectionRefusedError('message'))
    >>> accept_ConnectionError(ConnectionResetError('message'))
    >>> class MyExceptionSubtype_ConnectionResetError(ConnectionResetError): pass
    >>> accept_ConnectionError(MyExceptionSubtype_ConnectionResetError('message'))
    """
    exc_var: ConnectionError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ConnectionError in type(exc).__mro__
    assert isinstance(exc, ConnectionError)
    assert exc.args == ('message',)

def accept_ConnectionRefusedError(exc: ConnectionRefusedError):
    """
    >>> accept_ConnectionRefusedError(ConnectionRefusedError('message'))
    >>> class MyExceptionSubtype_ConnectionRefusedError(ConnectionRefusedError): pass
    >>> accept_ConnectionRefusedError(MyExceptionSubtype_ConnectionRefusedError('message'))
    """
    exc_var: ConnectionRefusedError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ConnectionRefusedError in type(exc).__mro__
    assert isinstance(exc, ConnectionRefusedError)
    assert exc.args == ('message',)

def accept_ConnectionResetError(exc: ConnectionResetError):
    """
    >>> accept_ConnectionResetError(ConnectionResetError('message'))
    >>> class MyExceptionSubtype_ConnectionResetError(ConnectionResetError): pass
    >>> accept_ConnectionResetError(MyExceptionSubtype_ConnectionResetError('message'))
    """
    exc_var: ConnectionResetError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ConnectionResetError in type(exc).__mro__
    assert isinstance(exc, ConnectionResetError)
    assert exc.args == ('message',)

def accept_DeprecationWarning(exc: DeprecationWarning):
    """
    >>> accept_DeprecationWarning(DeprecationWarning('message'))
    >>> class MyExceptionSubtype_DeprecationWarning(DeprecationWarning): pass
    >>> accept_DeprecationWarning(MyExceptionSubtype_DeprecationWarning('message'))
    """
    exc_var: DeprecationWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert DeprecationWarning in type(exc).__mro__
    assert isinstance(exc, DeprecationWarning)
    assert exc.args == ('message',)

def accept_EOFError(exc: EOFError):
    """
    >>> accept_EOFError(EOFError('message'))
    >>> class MyExceptionSubtype_EOFError(EOFError): pass
    >>> accept_EOFError(MyExceptionSubtype_EOFError('message'))
    """
    exc_var: EOFError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert EOFError in type(exc).__mro__
    assert isinstance(exc, EOFError)
    assert exc.args == ('message',)

def accept_Exception(exc: Exception):
    """
    >>> accept_Exception(Exception('message'))
    >>> class MyExceptionSubtype_Exception(Exception): pass
    >>> accept_Exception(MyExceptionSubtype_Exception('message'))
    >>> accept_Exception(ArithmeticError('message'))
    >>> class MyExceptionSubtype_ArithmeticError(ArithmeticError): pass
    >>> accept_Exception(MyExceptionSubtype_ArithmeticError('message'))
    >>> accept_Exception(AssertionError('message'))
    >>> class MyExceptionSubtype_AssertionError(AssertionError): pass
    >>> accept_Exception(MyExceptionSubtype_AssertionError('message'))
    >>> accept_Exception(AttributeError('message'))
    >>> class MyExceptionSubtype_AttributeError(AttributeError): pass
    >>> accept_Exception(MyExceptionSubtype_AttributeError('message'))
    >>> accept_Exception(BufferError('message'))
    >>> class MyExceptionSubtype_BufferError(BufferError): pass
    >>> accept_Exception(MyExceptionSubtype_BufferError('message'))
    >>> accept_Exception(EOFError('message'))
    >>> class MyExceptionSubtype_EOFError(EOFError): pass
    >>> accept_Exception(MyExceptionSubtype_EOFError('message'))
    >>> accept_Exception(ImportError('message'))
    >>> class MyExceptionSubtype_ImportError(ImportError): pass
    >>> accept_Exception(MyExceptionSubtype_ImportError('message'))
    >>> accept_Exception(LookupError('message'))
    >>> class MyExceptionSubtype_LookupError(LookupError): pass
    >>> accept_Exception(MyExceptionSubtype_LookupError('message'))
    >>> accept_Exception(MemoryError('message'))
    >>> class MyExceptionSubtype_MemoryError(MemoryError): pass
    >>> accept_Exception(MyExceptionSubtype_MemoryError('message'))
    >>> accept_Exception(NameError('message'))
    >>> class MyExceptionSubtype_NameError(NameError): pass
    >>> accept_Exception(MyExceptionSubtype_NameError('message'))
    >>> accept_Exception(OSError('message'))
    >>> class MyExceptionSubtype_OSError(OSError): pass
    >>> accept_Exception(MyExceptionSubtype_OSError('message'))
    >>> accept_Exception(ReferenceError('message'))
    >>> class MyExceptionSubtype_ReferenceError(ReferenceError): pass
    >>> accept_Exception(MyExceptionSubtype_ReferenceError('message'))
    >>> accept_Exception(RuntimeError('message'))
    >>> class MyExceptionSubtype_RuntimeError(RuntimeError): pass
    >>> accept_Exception(MyExceptionSubtype_RuntimeError('message'))
    >>> accept_Exception(StopAsyncIteration('message'))
    >>> class MyExceptionSubtype_StopAsyncIteration(StopAsyncIteration): pass
    >>> accept_Exception(MyExceptionSubtype_StopAsyncIteration('message'))
    >>> accept_Exception(StopIteration('message'))
    >>> class MyExceptionSubtype_StopIteration(StopIteration): pass
    >>> accept_Exception(MyExceptionSubtype_StopIteration('message'))
    >>> accept_Exception(SyntaxError('message'))
    >>> class MyExceptionSubtype_SyntaxError(SyntaxError): pass
    >>> accept_Exception(MyExceptionSubtype_SyntaxError('message'))
    >>> accept_Exception(SystemError('message'))
    >>> class MyExceptionSubtype_SystemError(SystemError): pass
    >>> accept_Exception(MyExceptionSubtype_SystemError('message'))
    >>> accept_Exception(TypeError('message'))
    >>> class MyExceptionSubtype_TypeError(TypeError): pass
    >>> accept_Exception(MyExceptionSubtype_TypeError('message'))
    >>> accept_Exception(ValueError('message'))
    >>> class MyExceptionSubtype_ValueError(ValueError): pass
    >>> accept_Exception(MyExceptionSubtype_ValueError('message'))
    >>> accept_Exception(Warning('message'))
    >>> class MyExceptionSubtype_Warning(Warning): pass
    >>> accept_Exception(MyExceptionSubtype_Warning('message'))
    >>> accept_Exception(FloatingPointError('message'))
    >>> class MyExceptionSubtype_FloatingPointError(FloatingPointError): pass
    >>> accept_Exception(MyExceptionSubtype_FloatingPointError('message'))
    >>> accept_Exception(OverflowError('message'))
    >>> class MyExceptionSubtype_OverflowError(OverflowError): pass
    >>> accept_Exception(MyExceptionSubtype_OverflowError('message'))
    >>> accept_Exception(ZeroDivisionError('message'))
    >>> class MyExceptionSubtype_ZeroDivisionError(ZeroDivisionError): pass
    >>> accept_Exception(MyExceptionSubtype_ZeroDivisionError('message'))
    >>> accept_Exception(BytesWarning('message'))
    >>> class MyExceptionSubtype_BytesWarning(BytesWarning): pass
    >>> accept_Exception(MyExceptionSubtype_BytesWarning('message'))
    >>> accept_Exception(DeprecationWarning('message'))
    >>> class MyExceptionSubtype_DeprecationWarning(DeprecationWarning): pass
    >>> accept_Exception(MyExceptionSubtype_DeprecationWarning('message'))
    >>> accept_Exception(FutureWarning('message'))
    >>> class MyExceptionSubtype_FutureWarning(FutureWarning): pass
    >>> accept_Exception(MyExceptionSubtype_FutureWarning('message'))
    >>> accept_Exception(ImportWarning('message'))
    >>> class MyExceptionSubtype_ImportWarning(ImportWarning): pass
    >>> accept_Exception(MyExceptionSubtype_ImportWarning('message'))
    >>> accept_Exception(PendingDeprecationWarning('message'))
    >>> class MyExceptionSubtype_PendingDeprecationWarning(PendingDeprecationWarning): pass
    >>> accept_Exception(MyExceptionSubtype_PendingDeprecationWarning('message'))
    >>> accept_Exception(ResourceWarning('message'))
    >>> class MyExceptionSubtype_ResourceWarning(ResourceWarning): pass
    >>> accept_Exception(MyExceptionSubtype_ResourceWarning('message'))
    >>> accept_Exception(RuntimeWarning('message'))
    >>> class MyExceptionSubtype_RuntimeWarning(RuntimeWarning): pass
    >>> accept_Exception(MyExceptionSubtype_RuntimeWarning('message'))
    >>> accept_Exception(SyntaxWarning('message'))
    >>> class MyExceptionSubtype_SyntaxWarning(SyntaxWarning): pass
    >>> accept_Exception(MyExceptionSubtype_SyntaxWarning('message'))
    >>> accept_Exception(UnicodeWarning('message'))
    >>> class MyExceptionSubtype_UnicodeWarning(UnicodeWarning): pass
    >>> accept_Exception(MyExceptionSubtype_UnicodeWarning('message'))
    >>> accept_Exception(UserWarning('message'))
    >>> class MyExceptionSubtype_UserWarning(UserWarning): pass
    >>> accept_Exception(MyExceptionSubtype_UserWarning('message'))
    >>> accept_Exception(BlockingIOError('message'))
    >>> class MyExceptionSubtype_BlockingIOError(BlockingIOError): pass
    >>> accept_Exception(MyExceptionSubtype_BlockingIOError('message'))
    >>> accept_Exception(ChildProcessError('message'))
    >>> class MyExceptionSubtype_ChildProcessError(ChildProcessError): pass
    >>> accept_Exception(MyExceptionSubtype_ChildProcessError('message'))
    >>> accept_Exception(ConnectionError('message'))
    >>> class MyExceptionSubtype_ConnectionError(ConnectionError): pass
    >>> accept_Exception(MyExceptionSubtype_ConnectionError('message'))
    >>> accept_Exception(FileExistsError('message'))
    >>> class MyExceptionSubtype_FileExistsError(FileExistsError): pass
    >>> accept_Exception(MyExceptionSubtype_FileExistsError('message'))
    >>> accept_Exception(FileNotFoundError('message'))
    >>> class MyExceptionSubtype_FileNotFoundError(FileNotFoundError): pass
    >>> accept_Exception(MyExceptionSubtype_FileNotFoundError('message'))
    >>> accept_Exception(InterruptedError('message'))
    >>> class MyExceptionSubtype_InterruptedError(InterruptedError): pass
    >>> accept_Exception(MyExceptionSubtype_InterruptedError('message'))
    >>> accept_Exception(IsADirectoryError('message'))
    >>> class MyExceptionSubtype_IsADirectoryError(IsADirectoryError): pass
    >>> accept_Exception(MyExceptionSubtype_IsADirectoryError('message'))
    >>> accept_Exception(NotADirectoryError('message'))
    >>> class MyExceptionSubtype_NotADirectoryError(NotADirectoryError): pass
    >>> accept_Exception(MyExceptionSubtype_NotADirectoryError('message'))
    >>> accept_Exception(PermissionError('message'))
    >>> class MyExceptionSubtype_PermissionError(PermissionError): pass
    >>> accept_Exception(MyExceptionSubtype_PermissionError('message'))
    >>> accept_Exception(ProcessLookupError('message'))
    >>> class MyExceptionSubtype_ProcessLookupError(ProcessLookupError): pass
    >>> accept_Exception(MyExceptionSubtype_ProcessLookupError('message'))
    >>> accept_Exception(TimeoutError('message'))
    >>> class MyExceptionSubtype_TimeoutError(TimeoutError): pass
    >>> accept_Exception(MyExceptionSubtype_TimeoutError('message'))
    >>> accept_Exception(IndentationError('message'))
    >>> class MyExceptionSubtype_IndentationError(IndentationError): pass
    >>> accept_Exception(MyExceptionSubtype_IndentationError('message'))
    >>> accept_Exception(IndexError('message'))
    >>> class MyExceptionSubtype_IndexError(IndexError): pass
    >>> accept_Exception(MyExceptionSubtype_IndexError('message'))
    >>> accept_Exception(KeyError('message'))
    >>> class MyExceptionSubtype_KeyError(KeyError): pass
    >>> accept_Exception(MyExceptionSubtype_KeyError('message'))
    >>> accept_Exception(ModuleNotFoundError('message'))
    >>> class MyExceptionSubtype_ModuleNotFoundError(ModuleNotFoundError): pass
    >>> accept_Exception(MyExceptionSubtype_ModuleNotFoundError('message'))
    >>> accept_Exception(NotImplementedError('message'))
    >>> class MyExceptionSubtype_NotImplementedError(NotImplementedError): pass
    >>> accept_Exception(MyExceptionSubtype_NotImplementedError('message'))
    >>> accept_Exception(RecursionError('message'))
    >>> class MyExceptionSubtype_RecursionError(RecursionError): pass
    >>> accept_Exception(MyExceptionSubtype_RecursionError('message'))
    >>> accept_Exception(UnboundLocalError('message'))
    >>> class MyExceptionSubtype_UnboundLocalError(UnboundLocalError): pass
    >>> accept_Exception(MyExceptionSubtype_UnboundLocalError('message'))
    >>> accept_Exception(UnicodeError('message'))
    >>> class MyExceptionSubtype_UnicodeError(UnicodeError): pass
    >>> accept_Exception(MyExceptionSubtype_UnicodeError('message'))
    >>> accept_Exception(BrokenPipeError('message'))
    >>> class MyExceptionSubtype_BrokenPipeError(BrokenPipeError): pass
    >>> accept_Exception(MyExceptionSubtype_BrokenPipeError('message'))
    >>> accept_Exception(ConnectionAbortedError('message'))
    >>> class MyExceptionSubtype_ConnectionAbortedError(ConnectionAbortedError): pass
    >>> accept_Exception(MyExceptionSubtype_ConnectionAbortedError('message'))
    >>> accept_Exception(ConnectionRefusedError('message'))
    >>> class MyExceptionSubtype_ConnectionRefusedError(ConnectionRefusedError): pass
    >>> accept_Exception(MyExceptionSubtype_ConnectionRefusedError('message'))
    >>> accept_Exception(ConnectionResetError('message'))
    >>> class MyExceptionSubtype_ConnectionResetError(ConnectionResetError): pass
    >>> accept_Exception(MyExceptionSubtype_ConnectionResetError('message'))
    >>> accept_Exception(TabError('message'))
    >>> class MyExceptionSubtype_TabError(TabError): pass
    >>> accept_Exception(MyExceptionSubtype_TabError('message'))
    >>> accept_Exception(EnvironmentError('message'))
    >>> class MyExceptionSubtype_EnvironmentError(EnvironmentError): pass
    >>> accept_Exception(MyExceptionSubtype_EnvironmentError('message'))
    >>> accept_Exception(IOError('message'))
    >>> class MyExceptionSubtype_IOError(IOError): pass
    >>> accept_Exception(MyExceptionSubtype_IOError('message'))
    """
    exc_var: Exception = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert Exception in type(exc).__mro__
    assert isinstance(exc, Exception)
    assert exc.args == ('message',)

def accept_FileExistsError(exc: FileExistsError):
    """
    >>> accept_FileExistsError(FileExistsError('message'))
    >>> class MyExceptionSubtype_FileExistsError(FileExistsError): pass
    >>> accept_FileExistsError(MyExceptionSubtype_FileExistsError('message'))
    """
    exc_var: FileExistsError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert FileExistsError in type(exc).__mro__
    assert isinstance(exc, FileExistsError)
    assert exc.args == ('message',)

def accept_FileNotFoundError(exc: FileNotFoundError):
    """
    >>> accept_FileNotFoundError(FileNotFoundError('message'))
    >>> class MyExceptionSubtype_FileNotFoundError(FileNotFoundError): pass
    >>> accept_FileNotFoundError(MyExceptionSubtype_FileNotFoundError('message'))
    """
    exc_var: FileNotFoundError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert FileNotFoundError in type(exc).__mro__
    assert isinstance(exc, FileNotFoundError)
    assert exc.args == ('message',)

def accept_FloatingPointError(exc: FloatingPointError):
    """
    >>> accept_FloatingPointError(FloatingPointError('message'))
    >>> class MyExceptionSubtype_FloatingPointError(FloatingPointError): pass
    >>> accept_FloatingPointError(MyExceptionSubtype_FloatingPointError('message'))
    """
    exc_var: FloatingPointError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert FloatingPointError in type(exc).__mro__
    assert isinstance(exc, FloatingPointError)
    assert exc.args == ('message',)

def accept_FutureWarning(exc: FutureWarning):
    """
    >>> accept_FutureWarning(FutureWarning('message'))
    >>> class MyExceptionSubtype_FutureWarning(FutureWarning): pass
    >>> accept_FutureWarning(MyExceptionSubtype_FutureWarning('message'))
    """
    exc_var: FutureWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert FutureWarning in type(exc).__mro__
    assert isinstance(exc, FutureWarning)
    assert exc.args == ('message',)

def accept_GeneratorExit(exc: GeneratorExit):
    """
    >>> accept_GeneratorExit(GeneratorExit('message'))
    >>> class MyExceptionSubtype_GeneratorExit(GeneratorExit): pass
    >>> accept_GeneratorExit(MyExceptionSubtype_GeneratorExit('message'))
    """
    exc_var: GeneratorExit = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert GeneratorExit in type(exc).__mro__
    assert isinstance(exc, GeneratorExit)
    assert exc.args == ('message',)

def accept_ImportError(exc: ImportError):
    """
    >>> accept_ImportError(ImportError('message'))
    >>> class MyExceptionSubtype_ImportError(ImportError): pass
    >>> accept_ImportError(MyExceptionSubtype_ImportError('message'))
    >>> accept_ImportError(ModuleNotFoundError('message'))
    >>> class MyExceptionSubtype_ModuleNotFoundError(ModuleNotFoundError): pass
    >>> accept_ImportError(MyExceptionSubtype_ModuleNotFoundError('message'))
    """
    exc_var: ImportError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ImportError in type(exc).__mro__
    assert isinstance(exc, ImportError)
    assert exc.args == ('message',)

def accept_ImportWarning(exc: ImportWarning):
    """
    >>> accept_ImportWarning(ImportWarning('message'))
    >>> class MyExceptionSubtype_ImportWarning(ImportWarning): pass
    >>> accept_ImportWarning(MyExceptionSubtype_ImportWarning('message'))
    """
    exc_var: ImportWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ImportWarning in type(exc).__mro__
    assert isinstance(exc, ImportWarning)
    assert exc.args == ('message',)

def accept_IndentationError(exc: IndentationError):
    """
    >>> accept_IndentationError(IndentationError('message'))
    >>> class MyExceptionSubtype_IndentationError(IndentationError): pass
    >>> accept_IndentationError(MyExceptionSubtype_IndentationError('message'))
    >>> accept_IndentationError(TabError('message'))
    >>> class MyExceptionSubtype_TabError(TabError): pass
    >>> accept_IndentationError(MyExceptionSubtype_TabError('message'))
    """
    exc_var: IndentationError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert IndentationError in type(exc).__mro__
    assert isinstance(exc, IndentationError)
    assert exc.args == ('message',)

def accept_IndexError(exc: IndexError):
    """
    >>> accept_IndexError(IndexError('message'))
    >>> class MyExceptionSubtype_IndexError(IndexError): pass
    >>> accept_IndexError(MyExceptionSubtype_IndexError('message'))
    """
    exc_var: IndexError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert IndexError in type(exc).__mro__
    assert isinstance(exc, IndexError)
    assert exc.args == ('message',)

def accept_InterruptedError(exc: InterruptedError):
    """
    >>> accept_InterruptedError(InterruptedError('message'))
    >>> class MyExceptionSubtype_InterruptedError(InterruptedError): pass
    >>> accept_InterruptedError(MyExceptionSubtype_InterruptedError('message'))
    """
    exc_var: InterruptedError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert InterruptedError in type(exc).__mro__
    assert isinstance(exc, InterruptedError)
    assert exc.args == ('message',)

def accept_IsADirectoryError(exc: IsADirectoryError):
    """
    >>> accept_IsADirectoryError(IsADirectoryError('message'))
    >>> class MyExceptionSubtype_IsADirectoryError(IsADirectoryError): pass
    >>> accept_IsADirectoryError(MyExceptionSubtype_IsADirectoryError('message'))
    """
    exc_var: IsADirectoryError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert IsADirectoryError in type(exc).__mro__
    assert isinstance(exc, IsADirectoryError)
    assert exc.args == ('message',)

def accept_KeyError(exc: KeyError):
    """
    >>> accept_KeyError(KeyError('message'))
    >>> class MyExceptionSubtype_KeyError(KeyError): pass
    >>> accept_KeyError(MyExceptionSubtype_KeyError('message'))
    """
    exc_var: KeyError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert KeyError in type(exc).__mro__
    assert isinstance(exc, KeyError)
    assert exc.args == ('message',)

def accept_KeyboardInterrupt(exc: KeyboardInterrupt):
    """
    >>> accept_KeyboardInterrupt(KeyboardInterrupt('message'))
    >>> class MyExceptionSubtype_KeyboardInterrupt(KeyboardInterrupt): pass
    >>> accept_KeyboardInterrupt(MyExceptionSubtype_KeyboardInterrupt('message'))
    """
    exc_var: KeyboardInterrupt = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert KeyboardInterrupt in type(exc).__mro__
    assert isinstance(exc, KeyboardInterrupt)
    assert exc.args == ('message',)

def accept_LookupError(exc: LookupError):
    """
    >>> accept_LookupError(LookupError('message'))
    >>> class MyExceptionSubtype_LookupError(LookupError): pass
    >>> accept_LookupError(MyExceptionSubtype_LookupError('message'))
    >>> accept_LookupError(IndexError('message'))
    >>> class MyExceptionSubtype_IndexError(IndexError): pass
    >>> accept_LookupError(MyExceptionSubtype_IndexError('message'))
    >>> accept_LookupError(KeyError('message'))
    >>> class MyExceptionSubtype_KeyError(KeyError): pass
    >>> accept_LookupError(MyExceptionSubtype_KeyError('message'))
    """
    exc_var: LookupError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert LookupError in type(exc).__mro__
    assert isinstance(exc, LookupError)
    assert exc.args == ('message',)

def accept_MemoryError(exc: MemoryError):
    """
    >>> accept_MemoryError(MemoryError('message'))
    >>> class MyExceptionSubtype_MemoryError(MemoryError): pass
    >>> accept_MemoryError(MyExceptionSubtype_MemoryError('message'))
    """
    exc_var: MemoryError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert MemoryError in type(exc).__mro__
    assert isinstance(exc, MemoryError)
    assert exc.args == ('message',)

def accept_ModuleNotFoundError(exc: ModuleNotFoundError):
    """
    >>> accept_ModuleNotFoundError(ModuleNotFoundError('message'))
    >>> class MyExceptionSubtype_ModuleNotFoundError(ModuleNotFoundError): pass
    >>> accept_ModuleNotFoundError(MyExceptionSubtype_ModuleNotFoundError('message'))
    """
    exc_var: ModuleNotFoundError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ModuleNotFoundError in type(exc).__mro__
    assert isinstance(exc, ModuleNotFoundError)
    assert exc.args == ('message',)

def accept_NameError(exc: NameError):
    """
    >>> accept_NameError(NameError('message'))
    >>> class MyExceptionSubtype_NameError(NameError): pass
    >>> accept_NameError(MyExceptionSubtype_NameError('message'))
    >>> accept_NameError(UnboundLocalError('message'))
    >>> class MyExceptionSubtype_UnboundLocalError(UnboundLocalError): pass
    >>> accept_NameError(MyExceptionSubtype_UnboundLocalError('message'))
    """
    exc_var: NameError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert NameError in type(exc).__mro__
    assert isinstance(exc, NameError)
    assert exc.args == ('message',)

def accept_NotADirectoryError(exc: NotADirectoryError):
    """
    >>> accept_NotADirectoryError(NotADirectoryError('message'))
    >>> class MyExceptionSubtype_NotADirectoryError(NotADirectoryError): pass
    >>> accept_NotADirectoryError(MyExceptionSubtype_NotADirectoryError('message'))
    """
    exc_var: NotADirectoryError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert NotADirectoryError in type(exc).__mro__
    assert isinstance(exc, NotADirectoryError)
    assert exc.args == ('message',)

def accept_NotImplementedError(exc: NotImplementedError):
    """
    >>> accept_NotImplementedError(NotImplementedError('message'))
    >>> class MyExceptionSubtype_NotImplementedError(NotImplementedError): pass
    >>> accept_NotImplementedError(MyExceptionSubtype_NotImplementedError('message'))
    """
    exc_var: NotImplementedError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert NotImplementedError in type(exc).__mro__
    assert isinstance(exc, NotImplementedError)
    assert exc.args == ('message',)

def accept_OSError(exc: OSError):
    """
    >>> accept_OSError(OSError('message'))
    >>> class MyExceptionSubtype_OSError(OSError): pass
    >>> accept_OSError(MyExceptionSubtype_OSError('message'))
    >>> accept_OSError(BlockingIOError('message'))
    >>> class MyExceptionSubtype_BlockingIOError(BlockingIOError): pass
    >>> accept_OSError(MyExceptionSubtype_BlockingIOError('message'))
    >>> accept_OSError(ChildProcessError('message'))
    >>> class MyExceptionSubtype_ChildProcessError(ChildProcessError): pass
    >>> accept_OSError(MyExceptionSubtype_ChildProcessError('message'))
    >>> accept_OSError(ConnectionError('message'))
    >>> class MyExceptionSubtype_ConnectionError(ConnectionError): pass
    >>> accept_OSError(MyExceptionSubtype_ConnectionError('message'))
    >>> accept_OSError(FileExistsError('message'))
    >>> class MyExceptionSubtype_FileExistsError(FileExistsError): pass
    >>> accept_OSError(MyExceptionSubtype_FileExistsError('message'))
    >>> accept_OSError(FileNotFoundError('message'))
    >>> class MyExceptionSubtype_FileNotFoundError(FileNotFoundError): pass
    >>> accept_OSError(MyExceptionSubtype_FileNotFoundError('message'))
    >>> accept_OSError(InterruptedError('message'))
    >>> class MyExceptionSubtype_InterruptedError(InterruptedError): pass
    >>> accept_OSError(MyExceptionSubtype_InterruptedError('message'))
    >>> accept_OSError(IsADirectoryError('message'))
    >>> class MyExceptionSubtype_IsADirectoryError(IsADirectoryError): pass
    >>> accept_OSError(MyExceptionSubtype_IsADirectoryError('message'))
    >>> accept_OSError(NotADirectoryError('message'))
    >>> class MyExceptionSubtype_NotADirectoryError(NotADirectoryError): pass
    >>> accept_OSError(MyExceptionSubtype_NotADirectoryError('message'))
    >>> accept_OSError(PermissionError('message'))
    >>> class MyExceptionSubtype_PermissionError(PermissionError): pass
    >>> accept_OSError(MyExceptionSubtype_PermissionError('message'))
    >>> accept_OSError(ProcessLookupError('message'))
    >>> class MyExceptionSubtype_ProcessLookupError(ProcessLookupError): pass
    >>> accept_OSError(MyExceptionSubtype_ProcessLookupError('message'))
    >>> accept_OSError(TimeoutError('message'))
    >>> class MyExceptionSubtype_TimeoutError(TimeoutError): pass
    >>> accept_OSError(MyExceptionSubtype_TimeoutError('message'))
    >>> accept_OSError(BrokenPipeError('message'))
    >>> class MyExceptionSubtype_BrokenPipeError(BrokenPipeError): pass
    >>> accept_OSError(MyExceptionSubtype_BrokenPipeError('message'))
    >>> accept_OSError(ConnectionAbortedError('message'))
    >>> class MyExceptionSubtype_ConnectionAbortedError(ConnectionAbortedError): pass
    >>> accept_OSError(MyExceptionSubtype_ConnectionAbortedError('message'))
    >>> accept_OSError(ConnectionRefusedError('message'))
    >>> class MyExceptionSubtype_ConnectionRefusedError(ConnectionRefusedError): pass
    >>> accept_OSError(MyExceptionSubtype_ConnectionRefusedError('message'))
    >>> accept_OSError(ConnectionResetError('message'))
    >>> class MyExceptionSubtype_ConnectionResetError(ConnectionResetError): pass
    >>> accept_OSError(MyExceptionSubtype_ConnectionResetError('message'))
    >>> accept_OSError(EnvironmentError('message'))
    >>> class MyExceptionSubtype_EnvironmentError(EnvironmentError): pass
    >>> accept_OSError(MyExceptionSubtype_EnvironmentError('message'))
    >>> accept_OSError(IOError('message'))
    >>> class MyExceptionSubtype_IOError(IOError): pass
    >>> accept_OSError(MyExceptionSubtype_IOError('message'))
    """
    exc_var: OSError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert OSError in type(exc).__mro__
    assert isinstance(exc, OSError)
    assert exc.args == ('message',)

def accept_OverflowError(exc: OverflowError):
    """
    >>> accept_OverflowError(OverflowError('message'))
    >>> class MyExceptionSubtype_OverflowError(OverflowError): pass
    >>> accept_OverflowError(MyExceptionSubtype_OverflowError('message'))
    """
    exc_var: OverflowError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert OverflowError in type(exc).__mro__
    assert isinstance(exc, OverflowError)
    assert exc.args == ('message',)

def accept_PendingDeprecationWarning(exc: PendingDeprecationWarning):
    """
    >>> accept_PendingDeprecationWarning(PendingDeprecationWarning('message'))
    >>> class MyExceptionSubtype_PendingDeprecationWarning(PendingDeprecationWarning): pass
    >>> accept_PendingDeprecationWarning(MyExceptionSubtype_PendingDeprecationWarning('message'))
    """
    exc_var: PendingDeprecationWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert PendingDeprecationWarning in type(exc).__mro__
    assert isinstance(exc, PendingDeprecationWarning)
    assert exc.args == ('message',)

def accept_PermissionError(exc: PermissionError):
    """
    >>> accept_PermissionError(PermissionError('message'))
    >>> class MyExceptionSubtype_PermissionError(PermissionError): pass
    >>> accept_PermissionError(MyExceptionSubtype_PermissionError('message'))
    """
    exc_var: PermissionError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert PermissionError in type(exc).__mro__
    assert isinstance(exc, PermissionError)
    assert exc.args == ('message',)

def accept_ProcessLookupError(exc: ProcessLookupError):
    """
    >>> accept_ProcessLookupError(ProcessLookupError('message'))
    >>> class MyExceptionSubtype_ProcessLookupError(ProcessLookupError): pass
    >>> accept_ProcessLookupError(MyExceptionSubtype_ProcessLookupError('message'))
    """
    exc_var: ProcessLookupError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ProcessLookupError in type(exc).__mro__
    assert isinstance(exc, ProcessLookupError)
    assert exc.args == ('message',)

def accept_RecursionError(exc: RecursionError):
    """
    >>> accept_RecursionError(RecursionError('message'))
    >>> class MyExceptionSubtype_RecursionError(RecursionError): pass
    >>> accept_RecursionError(MyExceptionSubtype_RecursionError('message'))
    """
    exc_var: RecursionError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert RecursionError in type(exc).__mro__
    assert isinstance(exc, RecursionError)
    assert exc.args == ('message',)

def accept_ReferenceError(exc: ReferenceError):
    """
    >>> accept_ReferenceError(ReferenceError('message'))
    >>> class MyExceptionSubtype_ReferenceError(ReferenceError): pass
    >>> accept_ReferenceError(MyExceptionSubtype_ReferenceError('message'))
    """
    exc_var: ReferenceError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ReferenceError in type(exc).__mro__
    assert isinstance(exc, ReferenceError)
    assert exc.args == ('message',)

def accept_ResourceWarning(exc: ResourceWarning):
    """
    >>> accept_ResourceWarning(ResourceWarning('message'))
    >>> class MyExceptionSubtype_ResourceWarning(ResourceWarning): pass
    >>> accept_ResourceWarning(MyExceptionSubtype_ResourceWarning('message'))
    """
    exc_var: ResourceWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ResourceWarning in type(exc).__mro__
    assert isinstance(exc, ResourceWarning)
    assert exc.args == ('message',)

def accept_RuntimeError(exc: RuntimeError):
    """
    >>> accept_RuntimeError(RuntimeError('message'))
    >>> class MyExceptionSubtype_RuntimeError(RuntimeError): pass
    >>> accept_RuntimeError(MyExceptionSubtype_RuntimeError('message'))
    >>> accept_RuntimeError(NotImplementedError('message'))
    >>> class MyExceptionSubtype_NotImplementedError(NotImplementedError): pass
    >>> accept_RuntimeError(MyExceptionSubtype_NotImplementedError('message'))
    >>> accept_RuntimeError(RecursionError('message'))
    >>> class MyExceptionSubtype_RecursionError(RecursionError): pass
    >>> accept_RuntimeError(MyExceptionSubtype_RecursionError('message'))
    """
    exc_var: RuntimeError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert RuntimeError in type(exc).__mro__
    assert isinstance(exc, RuntimeError)
    assert exc.args == ('message',)

def accept_RuntimeWarning(exc: RuntimeWarning):
    """
    >>> accept_RuntimeWarning(RuntimeWarning('message'))
    >>> class MyExceptionSubtype_RuntimeWarning(RuntimeWarning): pass
    >>> accept_RuntimeWarning(MyExceptionSubtype_RuntimeWarning('message'))
    """
    exc_var: RuntimeWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert RuntimeWarning in type(exc).__mro__
    assert isinstance(exc, RuntimeWarning)
    assert exc.args == ('message',)

def accept_StopAsyncIteration(exc: StopAsyncIteration):
    """
    >>> accept_StopAsyncIteration(StopAsyncIteration('message'))
    >>> class MyExceptionSubtype_StopAsyncIteration(StopAsyncIteration): pass
    >>> accept_StopAsyncIteration(MyExceptionSubtype_StopAsyncIteration('message'))
    """
    exc_var: StopAsyncIteration = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert StopAsyncIteration in type(exc).__mro__
    assert isinstance(exc, StopAsyncIteration)
    assert exc.args == ('message',)

def accept_StopIteration(exc: StopIteration):
    """
    >>> accept_StopIteration(StopIteration('message'))
    >>> class MyExceptionSubtype_StopIteration(StopIteration): pass
    >>> accept_StopIteration(MyExceptionSubtype_StopIteration('message'))
    """
    exc_var: StopIteration = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert StopIteration in type(exc).__mro__
    assert isinstance(exc, StopIteration)
    assert exc.args == ('message',)

def accept_SyntaxError(exc: SyntaxError):
    """
    >>> accept_SyntaxError(SyntaxError('message'))
    >>> class MyExceptionSubtype_SyntaxError(SyntaxError): pass
    >>> accept_SyntaxError(MyExceptionSubtype_SyntaxError('message'))
    >>> accept_SyntaxError(IndentationError('message'))
    >>> class MyExceptionSubtype_IndentationError(IndentationError): pass
    >>> accept_SyntaxError(MyExceptionSubtype_IndentationError('message'))
    >>> accept_SyntaxError(TabError('message'))
    >>> class MyExceptionSubtype_TabError(TabError): pass
    >>> accept_SyntaxError(MyExceptionSubtype_TabError('message'))
    """
    exc_var: SyntaxError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert SyntaxError in type(exc).__mro__
    assert isinstance(exc, SyntaxError)
    assert exc.args == ('message',)

def accept_SyntaxWarning(exc: SyntaxWarning):
    """
    >>> accept_SyntaxWarning(SyntaxWarning('message'))
    >>> class MyExceptionSubtype_SyntaxWarning(SyntaxWarning): pass
    >>> accept_SyntaxWarning(MyExceptionSubtype_SyntaxWarning('message'))
    """
    exc_var: SyntaxWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert SyntaxWarning in type(exc).__mro__
    assert isinstance(exc, SyntaxWarning)
    assert exc.args == ('message',)

def accept_SystemError(exc: SystemError):
    """
    >>> accept_SystemError(SystemError('message'))
    >>> class MyExceptionSubtype_SystemError(SystemError): pass
    >>> accept_SystemError(MyExceptionSubtype_SystemError('message'))
    """
    exc_var: SystemError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert SystemError in type(exc).__mro__
    assert isinstance(exc, SystemError)
    assert exc.args == ('message',)

def accept_SystemExit(exc: SystemExit):
    """
    >>> accept_SystemExit(SystemExit('message'))
    >>> class MyExceptionSubtype_SystemExit(SystemExit): pass
    >>> accept_SystemExit(MyExceptionSubtype_SystemExit('message'))
    """
    exc_var: SystemExit = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert SystemExit in type(exc).__mro__
    assert isinstance(exc, SystemExit)
    assert exc.args == ('message',)

def accept_TabError(exc: TabError):
    """
    >>> accept_TabError(TabError('message'))
    >>> class MyExceptionSubtype_TabError(TabError): pass
    >>> accept_TabError(MyExceptionSubtype_TabError('message'))
    """
    exc_var: TabError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert TabError in type(exc).__mro__
    assert isinstance(exc, TabError)
    assert exc.args == ('message',)

def accept_TimeoutError(exc: TimeoutError):
    """
    >>> accept_TimeoutError(TimeoutError('message'))
    >>> class MyExceptionSubtype_TimeoutError(TimeoutError): pass
    >>> accept_TimeoutError(MyExceptionSubtype_TimeoutError('message'))
    """
    exc_var: TimeoutError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert TimeoutError in type(exc).__mro__
    assert isinstance(exc, TimeoutError)
    assert exc.args == ('message',)

def accept_TypeError(exc: TypeError):
    """
    >>> accept_TypeError(TypeError('message'))
    >>> class MyExceptionSubtype_TypeError(TypeError): pass
    >>> accept_TypeError(MyExceptionSubtype_TypeError('message'))
    """
    exc_var: TypeError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert TypeError in type(exc).__mro__
    assert isinstance(exc, TypeError)
    assert exc.args == ('message',)

def accept_UnboundLocalError(exc: UnboundLocalError):
    """
    >>> accept_UnboundLocalError(UnboundLocalError('message'))
    >>> class MyExceptionSubtype_UnboundLocalError(UnboundLocalError): pass
    >>> accept_UnboundLocalError(MyExceptionSubtype_UnboundLocalError('message'))
    """
    exc_var: UnboundLocalError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert UnboundLocalError in type(exc).__mro__
    assert isinstance(exc, UnboundLocalError)
    assert exc.args == ('message',)

def accept_UnicodeError(exc: UnicodeError):
    """
    >>> accept_UnicodeError(UnicodeError('message'))
    >>> class MyExceptionSubtype_UnicodeError(UnicodeError): pass
    >>> accept_UnicodeError(MyExceptionSubtype_UnicodeError('message'))
    """
    exc_var: UnicodeError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert UnicodeError in type(exc).__mro__
    assert isinstance(exc, UnicodeError)
    assert exc.args == ('message',)

def accept_UnicodeWarning(exc: UnicodeWarning):
    """
    >>> accept_UnicodeWarning(UnicodeWarning('message'))
    >>> class MyExceptionSubtype_UnicodeWarning(UnicodeWarning): pass
    >>> accept_UnicodeWarning(MyExceptionSubtype_UnicodeWarning('message'))
    """
    exc_var: UnicodeWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert UnicodeWarning in type(exc).__mro__
    assert isinstance(exc, UnicodeWarning)
    assert exc.args == ('message',)

def accept_UserWarning(exc: UserWarning):
    """
    >>> accept_UserWarning(UserWarning('message'))
    >>> class MyExceptionSubtype_UserWarning(UserWarning): pass
    >>> accept_UserWarning(MyExceptionSubtype_UserWarning('message'))
    """
    exc_var: UserWarning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert UserWarning in type(exc).__mro__
    assert isinstance(exc, UserWarning)
    assert exc.args == ('message',)

def accept_ValueError(exc: ValueError):
    """
    >>> accept_ValueError(ValueError('message'))
    >>> class MyExceptionSubtype_ValueError(ValueError): pass
    >>> accept_ValueError(MyExceptionSubtype_ValueError('message'))
    >>> accept_ValueError(UnicodeError('message'))
    >>> class MyExceptionSubtype_UnicodeError(UnicodeError): pass
    >>> accept_ValueError(MyExceptionSubtype_UnicodeError('message'))
    """
    exc_var: ValueError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ValueError in type(exc).__mro__
    assert isinstance(exc, ValueError)
    assert exc.args == ('message',)

def accept_Warning(exc: Warning):
    """
    >>> accept_Warning(Warning('message'))
    >>> class MyExceptionSubtype_Warning(Warning): pass
    >>> accept_Warning(MyExceptionSubtype_Warning('message'))
    >>> accept_Warning(BytesWarning('message'))
    >>> class MyExceptionSubtype_BytesWarning(BytesWarning): pass
    >>> accept_Warning(MyExceptionSubtype_BytesWarning('message'))
    >>> accept_Warning(DeprecationWarning('message'))
    >>> class MyExceptionSubtype_DeprecationWarning(DeprecationWarning): pass
    >>> accept_Warning(MyExceptionSubtype_DeprecationWarning('message'))
    >>> accept_Warning(FutureWarning('message'))
    >>> class MyExceptionSubtype_FutureWarning(FutureWarning): pass
    >>> accept_Warning(MyExceptionSubtype_FutureWarning('message'))
    >>> accept_Warning(ImportWarning('message'))
    >>> class MyExceptionSubtype_ImportWarning(ImportWarning): pass
    >>> accept_Warning(MyExceptionSubtype_ImportWarning('message'))
    >>> accept_Warning(PendingDeprecationWarning('message'))
    >>> class MyExceptionSubtype_PendingDeprecationWarning(PendingDeprecationWarning): pass
    >>> accept_Warning(MyExceptionSubtype_PendingDeprecationWarning('message'))
    >>> accept_Warning(ResourceWarning('message'))
    >>> class MyExceptionSubtype_ResourceWarning(ResourceWarning): pass
    >>> accept_Warning(MyExceptionSubtype_ResourceWarning('message'))
    >>> accept_Warning(RuntimeWarning('message'))
    >>> class MyExceptionSubtype_RuntimeWarning(RuntimeWarning): pass
    >>> accept_Warning(MyExceptionSubtype_RuntimeWarning('message'))
    >>> accept_Warning(SyntaxWarning('message'))
    >>> class MyExceptionSubtype_SyntaxWarning(SyntaxWarning): pass
    >>> accept_Warning(MyExceptionSubtype_SyntaxWarning('message'))
    >>> accept_Warning(UnicodeWarning('message'))
    >>> class MyExceptionSubtype_UnicodeWarning(UnicodeWarning): pass
    >>> accept_Warning(MyExceptionSubtype_UnicodeWarning('message'))
    >>> accept_Warning(UserWarning('message'))
    >>> class MyExceptionSubtype_UserWarning(UserWarning): pass
    >>> accept_Warning(MyExceptionSubtype_UserWarning('message'))
    """
    exc_var: Warning = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert Warning in type(exc).__mro__
    assert isinstance(exc, Warning)
    assert exc.args == ('message',)

def accept_ZeroDivisionError(exc: ZeroDivisionError):
    """
    >>> accept_ZeroDivisionError(ZeroDivisionError('message'))
    >>> class MyExceptionSubtype_ZeroDivisionError(ZeroDivisionError): pass
    >>> accept_ZeroDivisionError(MyExceptionSubtype_ZeroDivisionError('message'))
    """
    exc_var: ZeroDivisionError = {exc}.pop()
    assert isinstance(exc, BaseException)
    assert ZeroDivisionError in type(exc).__mro__
    assert isinstance(exc, ZeroDivisionError)
    assert exc.args == ('message',)

##### END GENERATED TESTS


if __name__ == '__main__':
    gen_tests()