Skip to content
Myr

Merge pull request #2789 from briehanlombaard/fix-sslcontext-attribute-error

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

authored by David Lord · committed by GitHub · parents a35a97e, a913b4d · Browse files · 2 files+4 added−4 removed
This commit

State

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

Trailers

  • AttributeError: 'module' object has no attribute 'SSLContext'

Diff stats

2 files+4 added−4 removed

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

2 files+4 added−4 removed

modified:flask/cli.py+2 added-2 removed
668 unmodified lines
669 return value670671 obj = import_string(value, silent=True)672673 if sys.version_info < (2, 7):673 if sys.version_info < (2, 7, 9):674 if obj:675 return obj676 else:677 if isinstance(obj, ssl.SSLContext):
8 unmodified lines
686 """687 cert = ctx.params.get('cert')688 is_adhoc = cert == 'adhoc'689690 if sys.version_info < (2, 7):690 if sys.version_info < (2, 7, 9):691 is_context = cert and not isinstance(cert, (text_type, bytes))692 else:693 is_context = isinstance(cert, ssl.SSLContext)694
204 unmodified lines
modified:tests/test_cli.py+2 added-2 removed
519 unmodified lines
520 with pytest.raises(click.BadParameter):521 run_command.make_context('run', ['--cert', 'not_here'])522523 # not an SSLContext524 if sys.version_info >= (2, 7):524 if sys.version_info >= (2, 7, 9):525 with pytest.raises(click.BadParameter):526 run_command.make_context('run', ['--cert', 'flask'])527528 # SSLContext529 if sys.version_info < (2, 7):529 if sys.version_info < (2, 7, 9):530 ssl_context = object()531 else:532 ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)533
8 unmodified lines