You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only remove parens if we are sure it's an exception
Don't do it if the module scope is tainted - it may not be the builtin.
Only do it if the builtin is an exception in all supported python versions.
When we support targeting python versions this may be expanded.
Copy file name to clipboardExpand all lines: docs/source/transforms/remove_builtin_exception_brackets.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ This transform removes parentheses when raising builtin exceptions with no argum
6
6
The raise statement automatically instantiates exceptions with no arguments, so the parentheses are unnecessary.
7
7
This transform does nothing on Python 2.
8
8
9
+
If the exception is not a builtin exception, or has arguments, the parentheses are not removed.
10
+
9
11
This transform is enabled by default. Disable by passing the ``remove_builtin_exception_brackets=False`` argument to the :func:`python_minifier.minify` function,
10
12
or passing ``--no-remove-builtin-exception-brackets`` to the pyminify command.
0 commit comments