From a079213940ce64709476c46d062c8caefbca1b09 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 22 Jul 2017 09:13:57 -0400 Subject: [PATCH] Fixes #655 -- deprecate OpenSSL.tsafe (#673) * Fixes #655 -- deprecate OpenSSL.tsafe * changelog --- CHANGELOG.rst | 4 ++-- src/OpenSSL/tsafe.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index db6caddac..af2f26d43 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,8 +18,8 @@ Backward-incompatible changes: Deprecations: ^^^^^^^^^^^^^ -*none* - +- Deprecated ``OpenSSL.tsafe``. + `#673 `_ Changes: ^^^^^^^^ diff --git a/src/OpenSSL/tsafe.py b/src/OpenSSL/tsafe.py index 1cc0d2bb0..f1c6f67b3 100644 --- a/src/OpenSSL/tsafe.py +++ b/src/OpenSSL/tsafe.py @@ -1,8 +1,15 @@ +import warnings from threading import RLock as _RLock from OpenSSL import SSL as _ssl +warnings.warn( + "OpenSSL.tsafe is deprecated and will be removed", + DeprecationWarning, stacklevel=3 +) + + class Connection: def __init__(self, *args): self._ssl_conn = _ssl.Connection(*args)