MCPcopy Create free account
hub / github.com/pallets/flask / _set_debug

Function _set_debug

src/flask/cli.py:468–482  ·  view source on GitHub ↗
(ctx: click.Context, param: click.Option, value: bool)

Source from the content-addressed store, hash-verified

466
467
468def _set_debug(ctx: click.Context, param: click.Option, value: bool) -> bool | None:
469 # If the flag isn't provided, it will default to False. Don't use
470 # that, let debug be set by env in that case.
471 source = ctx.get_parameter_source(param.name) # type: ignore[arg-type]
472
473 if source is not None and source in (
474 ParameterSource.DEFAULT,
475 ParameterSource.DEFAULT_MAP,
476 ):
477 return None
478
479 # Set with env var instead of ScriptInfo.load so that it can be
480 # accessed early during a factory function.
481 os.environ["FLASK_DEBUG"] = "1" if value else "0"
482 return value
483
484
485_debug_option = click.Option(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected