colcon / colcon-cmake

Extension for colcon to support CMake packages
http://colcon.readthedocs.io
Apache License 2.0
16 stars 25 forks source link

👩‍🌾 Fix flake8: specify exception #102

Closed chapulina closed 3 years ago

chapulina commented 3 years ago

Refer to the docs:

https://docs.python.org/3/library/os.path.html#os.path.getmtime

https://github.com/osrf/buildfarmer/issues/145

chapulina commented 3 years ago

Can someone merge this? Me no have powers in this realm.

dirk-thomas commented 3 years ago

@chapulina can you please share the exact error message this addresses (and in which environment, e.g. the flake extension version).

chapulina commented 3 years ago

This fixes the Travis CI provided by this repository:

----------------------------- Captured stderr call -----------------------------

/home/travis/build/colcon/colcon-cmake/colcon_cmake/event_handler/compile_commands.py:71:1: B902 blind except Exception: statement

            except Exception:

^

/home/travis/build/colcon/colcon-cmake/colcon_cmake/event_handler/compile_commands.py:77:1: B902 blind except Exception: statement

                    except Exception:

^

flake8 reported 2 errors

------------------------------ Captured log call -------------------------------
jacobperron commented 3 years ago

B902 was introduced in a recent version of flake8-blind-except (https://github.com/elijahandrews/flake8-blind-except/pull/12). IMO, it's a bit overly restrictive and can be suppressed responsibly.

I've proposed a bunch of related PRs fixing CI in colcon repos:

dirk-thomas commented 3 years ago

Thanks for the patch.