colcon / colcon-cargo

An extension for colcon-core to support Rust projects built with Cargo
http://colcon.readthedocs.io
Apache License 2.0
30 stars 20 forks source link

Fix extract-data logic - return when TOML decoding fails #10

Closed bergercookie closed 3 years ago

bergercookie commented 3 years ago

Currently in extract_data if toml.load fails data is unset. Hence subsequent calls to data['name'] will fail. The correct approach is to return immediately in such cases.

Also TomlDecodeError may be triggered due to toml.load, so that's the only directive that must be wrapped in a try-except statement.

bergercookie commented 3 years ago

@ruffsl, @lelongg friendly ping :)

Could you guys (or anyone else interested) give me some feedback for my open PRs?

See also: https://github.com/colcon/colcon-cargo/pull/8, https://github.com/colcon/colcon-cargo/pull/9

esteve commented 3 years ago

@bergercookie thanks!