BaseException was used as a catch-all in situations where it
didn't make sense and where "Exception" is more appropriate
based on Python's documentation & error checking tools,
`pylint` warns `broad-exception-caught` for e.g.
BaseException includes SystemExit, KeyboardInterrupt & GeneratorExit,
so unless the intention is to catch calls to `sys.exit(..)`,
breaking a out of a loop using Ctrl-C or generator-exit,
then it shouldn't be used.
Even then, it's preferable to catch those exceptions explicitly.
As of [0] `intern/itasc/` is excluded from formatting,
however the formatting script was still running clang-format
on files in this directory.
Support ignoring directories to avoid the overhead of running
clang-format which does nothing.
Also add comments & skip creating paths to convert to spaces when
converting tabs to spaces isn't enabled.
[0]: 77617fce77
Directories in intern/ were selectively formatted based on
paths in `tools/utils_maintenance/clang_format_paths.py`.
This had the following problems:
- Editing files inside intern/ would auto-format on save with editors
setup to auto-format as there was nothing to disable formatting.
- Some directories were missing (by accident it seems).
Resolve by formatting all of `./intern/` exclude except for
`./intern/itasc/` which includes ITASC & KDL versions we might
want to sync with upstream.
When passing `.py` paths to the format command, clang-format paths
would be empty and operate on all paths.
Resolve by detecting cases when there is nothing to format.
Ref: !126055
This adds a Python file that can be loaded into GDB to improve the debugging
experience. This is similar to cfb60c98be which
contains a subset of the features provided here. While not being compatible with
other debuggers, specializing on just GDB allows us to use the GDB Python API
which is quite feature rich. Besides adding quite a few pretty-printers, this
also adds some frame filters which simplify backtraces. I've been using the
pretty-printers for quite some time myself already.
I added a basic guide on how to set it up in `blender_gdb_extension.py` but that
only covers the case when using `gdb` directly. If this is accepted, I can add
some more detailed guides on how to configure e.g. vscode to the developer docs.
The patch also contains some type hints for GDB which I wrote, which simplify
working with the GDB API.
Pull Request: https://projects.blender.org/blender/blender/pulls/126062
When autopep8 is accessed as a Python module (using `--no-subprocess`),
which is now default on MS-Windows.
- Perform version checks on the module version instead of the command.
- Remove checks for the command existing in the PATH.
- Adjust errors to make sense for a Python module.