mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-08 18:32:21 +00:00
[BugFix] - Fix pylint possibly-used-before-assignment (#6484)
* fix: comply w/ possibly used before assignment * remove disabe from .pylintrc * remove reset test * remove reset test * fix: update missing keys message
This commit is contained in:
@@ -59,9 +59,12 @@ def get_argument_optional_choices(parser: ArgumentParser, argument_name: str) ->
|
||||
"""Get the optional_choices attribute of an argument from an ArgumentParser."""
|
||||
for action in parser._actions: # pylint: disable=protected-access
|
||||
opts = action.option_strings
|
||||
if (opts and opts[0] == argument_name) or action.dest == argument_name:
|
||||
if hasattr(action, "optional_choices"):
|
||||
return action.optional_choices
|
||||
if (
|
||||
(opts and opts[0] == argument_name)
|
||||
or action.dest == argument_name
|
||||
and hasattr(action, "optional_choices")
|
||||
):
|
||||
return action.optional_choices
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user