Optionally surface exceptions that happen under executors by reading
[python_utils.git] / argparse_utils.py
index 8c254ae1f995f6aa684134c595e35968ea5b36cd..43536e460b7b4cc238c09d263bd36ae2b3b8f88e 100644 (file)
@@ -16,9 +16,7 @@ logger = logging.getLogger(__name__)
 
 
 class ActionNoYes(argparse.Action):
-    def __init__(
-        self, option_strings, dest, default=None, required=False, help=None
-    ):
+    def __init__(self, option_strings, dest, default=None, required=False, help=None):
         if default is None:
             msg = 'You must provide a default with Yes/No action'
             logger.critical(msg)
@@ -47,9 +45,7 @@ class ActionNoYes(argparse.Action):
 
     @overrides
     def __call__(self, parser, namespace, values, option_strings=None):
-        if option_strings.startswith('--no-') or option_strings.startswith(
-            '--no_'
-        ):
+        if option_strings.startswith('--no-') or option_strings.startswith('--no_'):
             setattr(namespace, self.dest, False)
         else:
             setattr(namespace, self.dest, True)