summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-11 08:45:37 -0500
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-11 08:45:37 -0500
commita8f7a941d1e142108d6c249fb99e7706d288d366 (patch)
tree920b65b0cacab4db5c0197eac31246f3d707ee59
parentf9fb8926cb43b3a7ec24e7a9aa8f7b10da01795b (diff)
downloadpyopenssl-a8f7a941d1e142108d6c249fb99e7706d288d366.tar.gz
Enforce byte strings, not native strings.
-rw-r--r--OpenSSL/rand.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSSL/rand.py b/OpenSSL/rand.py
index 9eed0d4..8c1a257 100644
--- a/OpenSSL/rand.py
+++ b/OpenSSL/rand.py
@@ -108,8 +108,8 @@ def egd(path, bytes=_unspecified):
:returns: The number of bytes read (NB: a value of 0 isn't necessarily an
error, check rand.status())
"""
- if not isinstance(path, str):
- raise TypeError("path must be a string")
+ if not isinstance(path, _builtin_bytes):
+ raise TypeError("path must be a byte string")
if bytes is _unspecified:
bytes = 255