]> git.madduck.net Git - etc/vim.git/blob - tests/data/simple_cases/remove_except_parens.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Upgrade to Furo 2023.9.10 to fix docs build (#3873)
[etc/vim.git] / tests / data / simple_cases / remove_except_parens.py
1 # These brackets are redundant, therefore remove.
2 try:
3     a.something
4 except (AttributeError) as err:
5     raise err
6
7 # This is tuple of exceptions.
8 # Although this could be replaced with just the exception,
9 # we do not remove brackets to preserve AST.
10 try:
11     a.something
12 except (AttributeError,) as err:
13     raise err
14
15 # This is a tuple of exceptions. Do not remove brackets.
16 try:
17     a.something
18 except (AttributeError, ValueError) as err:
19     raise err
20
21 # Test long variants.
22 try:
23     a.something
24 except (some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error) as err:
25     raise err
26
27 try:
28     a.something
29 except (some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error,) as err:
30     raise err
31
32 try:
33     a.something
34 except (some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error, some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error) as err:
35     raise err
36
37 # output
38 # These brackets are redundant, therefore remove.
39 try:
40     a.something
41 except AttributeError as err:
42     raise err
43
44 # This is tuple of exceptions.
45 # Although this could be replaced with just the exception,
46 # we do not remove brackets to preserve AST.
47 try:
48     a.something
49 except (AttributeError,) as err:
50     raise err
51
52 # This is a tuple of exceptions. Do not remove brackets.
53 try:
54     a.something
55 except (AttributeError, ValueError) as err:
56     raise err
57
58 # Test long variants.
59 try:
60     a.something
61 except (
62     some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error
63 ) as err:
64     raise err
65
66 try:
67     a.something
68 except (
69     some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error,
70 ) as err:
71     raise err
72
73 try:
74     a.something
75 except (
76     some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error,
77     some.really.really.really.looooooooooooooooooooooooooooooooong.module.over89.chars.Error,
78 ) as err:
79     raise err