Add suffix option to TestCase.mktemp
Generating tmp files properly ensures the cleanup.
diff --git a/OpenSSL/test/util.py b/OpenSSL/test/util.py
index 12e5eb8..c26a57a 100644
--- a/OpenSSL/test/util.py
+++ b/OpenSSL/test/util.py
@@ -296,13 +296,13 @@
_temporaryFiles = None
- def mktemp(self):
+ def mktemp(self, suffix=""):
"""
Pathetic substitute for twisted.trial.unittest.TestCase.mktemp.
"""
if self._temporaryFiles is None:
self._temporaryFiles = []
- temp = b(mktemp(dir="."))
+ temp = mktemp(suffix=suffix, dir=".").encode("utf-8")
self._temporaryFiles.append(temp)
return temp