RamenDR / ramen

Apache License 2.0
70 stars 51 forks source link

Help pylint with drenv.commands #1402

Closed nirs closed 2 months ago

nirs commented 2 months ago

Looks like recent change in pylint trigger this incorrect report:

drenv/commands.py:234:28: E0606: Possibly using variable
'input_view' before assignment (possibly-used-before-assignment)

This cannot happen since we don't register proc.stdin if input is None, so when we reach this block input_view is assigned. However disabling the check risk missing a real issue in that block.

Lets change the code so pylint can understand it better. This also make it easier to understand for humans. The cost is negligible, adding 2 temporary variables even when they are never used.