summaryrefslogtreecommitdiff
path: root/OpenSSL/SSL.py
diff options
context:
space:
mode:
authorAbraham Martin <amc203@cam.ac.uk>2015-03-25 10:35:44 +0000
committerAbraham Martin <amc203@cam.ac.uk>2015-03-25 10:35:44 +0000
commit2403ef5498f98cffcde210a382ae3c44d9be6332 (patch)
tree51daad427b2a1a7495d8fda311159d475e84d349 /OpenSSL/SSL.py
parente82326c9fd9571858146bdb986ea98be5b47ba77 (diff)
downloadpyopenssl-2403ef5498f98cffcde210a382ae3c44d9be6332.tar.gz
Emit proper warnings
Diffstat (limited to 'OpenSSL/SSL.py')
-rw-r--r--OpenSSL/SSL.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index ff0259a..5d9c360 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -1,3 +1,4 @@
+import warnings
from sys import platform
from functools import wraps, partial
from itertools import count
@@ -313,7 +314,7 @@ class Context(object):
# Backward compatibility
if isinstance(cafile, _text_type):
- DeprecationWarning("str object in cafile is no longer accepted, use bytes")
+ warnings.warn("str object in cafile is no longer accepted, use bytes", DeprecationWarning)
cafile = cafile.encode('utf-8')
if cafile is None:
@@ -979,7 +980,7 @@ class Connection(object):
# Backward compatibility
if isinstance(buf, _text_type):
- DeprecationWarning("str object in buf is no longer accepted, use bytes")
+ warnings.warn("str object in buf is no longer accepted, use bytes", DeprecationWarning)
buf = buf.encode('utf-8')
if isinstance(buf, _memoryview):
@@ -1009,7 +1010,7 @@ class Connection(object):
# Backward compatibility
if isinstance(buf, _text_type):
- DeprecationWarning("str object in buf is no longer accepted, use bytes")
+ warnings.warn("str object in buf is no longer accepted, use bytes", DeprecationWarning)
buf = buf.encode('utf-8')
if isinstance(buf, _memoryview):
@@ -1100,7 +1101,7 @@ class Connection(object):
# Backward compatibility
if isinstance(buf, _text_type):
- DeprecationWarning("str object in buf is no longer accepted, use bytes")
+ warnings.warn("str object in buf is no longer accepted, use bytes", DeprecationWarning)
buf = buf.encode("ascii")
if self._into_ssl is None: