Skip to content
Myr

Do not change the original structure of the code

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kevin Deldycke · committed by Kevin Deldycke · parent 634549f · Browse files · 1 file+11 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Address: https://github.com/pallets/click/pull/3030/files#r2289153981

Diff stats

1 file+11 added−9 removed

  • other:+11 added−9 removed

1 file+11 added−9 removed

modified:src/click/core.py+11 added-9 removed
2403 unmodified lines
2404 """2405 if not self.envvar:2406 return None24072408 envvars = [self.envvar] if isinstance(self.envvar, str) else self.envvar2409 for envvar in envvars:2410 rv = os.environ.get(envvar)2408 if isinstance(self.envvar, str):2409 rv = os.environ.get(self.envvar)24102412 # Return the first non-empty value of the list of environment variables.2411 if rv:2412 return rv2415 # Else, absence of value is interpreted as an environment variable that is2416 # not set, so proceed to the next one.2413 else:2414 for envvar in self.envvar:2415 rv = os.environ.get(envvar)24162417 # Return the first non-empty value of the list of environment variables.2418 if rv:2419 return rv2420 # Else, absence of value is interpreted as an environment variable that is2421 # not set, so proceed to the next one.24222423 return None24242425 def value_from_envvar(self, ctx: Context) -> str | cabc.Sequence[str] | None:2426 """Process the raw environment variable string for this parameter.
626 unmodified lines
3053 ):3054 envvar = f"{ctx.auto_envvar_prefix}_{self.name.upper()}"3055 rv = os.environ.get(envvar)30563052 # Return the first non-empty value of the list of environment variables.3057 if rv:3058 return rv3055 # Else, absence of value is interpreted as an environment variable that is3056 # not set, so proceed to the next one.30593060 return None30613062 def value_from_envvar(self, ctx: Context) -> t.Any:
212 unmodified lines