summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Rodrigues <rodrigc@FreeBSD.org>2016-07-26 18:35:03 -0700
committerMatěj Cepl <mcepl@cepl.eu>2018-02-05 22:21:42 +0100
commit038391c92f36d32e36e82d3b5fa10a734e5309e8 (patch)
tree2e6c25571d925ef1a0e16554e13339f34a063120 /tests
parentefe581320d3ceecc740f32625e33ff8633c4cdae (diff)
downloadm2crypto-038391c92f36d32e36e82d3b5fa10a734e5309e8.tar.gz
tests.makecerts: port to python3
* time.time() returns a float, but we need an int * X509.as_pem() returns bytes, so pass that directly to write() * cert.as_text() returns str, but we need to pass bytes to write()
Diffstat (limited to 'tests')
-rwxr-xr-xtests/makecerts.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/makecerts.py b/tests/makecerts.py
index 0cd4a4a..4013aa7 100755
--- a/tests/makecerts.py
+++ b/tests/makecerts.py
@@ -71,9 +71,8 @@ def req(name):
def save_text_pem_key(cert, name, with_key=True):
with open(name + '.pem', 'wb') as f:
for line in cert.as_text():
- f.write(line)
- for line in cert.as_pem():
- f.write(line)
+ f.write(line.encode("ascii"))
+ f.write(cert.as_pem())
if with_key:
with open(name + '_key.pem', 'rb') as key_f:
for line in key_f: