Skip to content

Commit a913b4d

Browse files
briehanlombaarddavidism
authored andcommitted
SSLContext was added in Python 2.7.9
1 parent a35a97e commit a913b4d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flask/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def convert(self, value, param, ctx):
670670

671671
obj = import_string(value, silent=True)
672672

673-
if sys.version_info < (2, 7):
673+
if sys.version_info < (2, 7, 9):
674674
if obj:
675675
return obj
676676
else:
@@ -687,7 +687,7 @@ def _validate_key(ctx, param, value):
687687
cert = ctx.params.get('cert')
688688
is_adhoc = cert == 'adhoc'
689689

690-
if sys.version_info < (2, 7):
690+
if sys.version_info < (2, 7, 9):
691691
is_context = cert and not isinstance(cert, (text_type, bytes))
692692
else:
693693
is_context = isinstance(cert, ssl.SSLContext)

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,12 @@ def test_run_cert_import(monkeypatch):
521521
run_command.make_context('run', ['--cert', 'not_here'])
522522

523523
# not an SSLContext
524-
if sys.version_info >= (2, 7):
524+
if sys.version_info >= (2, 7, 9):
525525
with pytest.raises(click.BadParameter):
526526
run_command.make_context('run', ['--cert', 'flask'])
527527

528528
# SSLContext
529-
if sys.version_info < (2, 7):
529+
if sys.version_info < (2, 7, 9):
530530
ssl_context = object()
531531
else:
532532
ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)

0 commit comments

Comments
 (0)