Skip to content
Myr

Merge pull request #973 from SWu/patch-1

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

Fix a typo

authored by David Lord · committed by GitHub · parents 18b0945, 78a15c7 · Browse files · 2 files+2 added−2 removed
This commit

State

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

Diff stats

2 files+2 added−2 removed

  • tests:+1 added−1 removed
  • other:+1 added−1 removed

2 files+2 added−2 removed

modified:click/types.py+1 added-1 removed
275 unmodified lines
276 def convert(self, value, param, ctx):277 if isinstance(value, bool):278 return bool(value)279 value = value.lower()280 if value in ('true', 't,' '1', 'yes', 'y'):280 if value in ('true', 't', '1', 'yes', 'y'):281 return True282 elif value in ('false', 'f', '0', 'no', 'n'):283 return False284 self.fail('%s is not a valid boolean' % value, param, ctx)
310 unmodified lines
modified:tests/test_basic.py+1 added-1 removed
185 unmodified lines
186 @click.option('--flag', default=default, type=bool)187 def cli(flag):188 click.echo(flag)189190 for value in 'true', 't,' '1', 'yes', 'y':190 for value in 'true', 't', '1', 'yes', 'y':191 result = runner.invoke(cli, ['--flag', value])192 assert not result.exception193 assert result.output == 'True\n'194
304 unmodified lines