summaryrefslogtreecommitdiff
path: root/tests/makecerts.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2016-07-22 11:12:54 +0200
committerMatěj Cepl <mcepl@cepl.eu>2016-12-15 14:46:06 +0100
commit9a95fb682c3f4236a9df9b41f301d2c85ac134d4 (patch)
treeed28c801a6701ae3cd860f487ad168d325c41fc5 /tests/makecerts.py
parentc295b5bc8aa9137938bfbe841b544a2a5c192ac1 (diff)
downloadm2crypto-9a95fb682c3f4236a9df9b41f301d2c85ac134d4.tar.gz
Elimination of all open() statements w/o context managers.
Diffstat (limited to 'tests/makecerts.py')
-rwxr-xr-xtests/makecerts.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/makecerts.py b/tests/makecerts.py
index 411fac2..0cd4a4a 100755
--- a/tests/makecerts.py
+++ b/tests/makecerts.py
@@ -75,8 +75,9 @@ def save_text_pem_key(cert, name, with_key=True):
for line in cert.as_pem():
f.write(line)
if with_key:
- for line in open(name + '_key.pem', 'rb'):
- f.write(line)
+ with open(name + '_key.pem', 'rb') as key_f:
+ for line in key_f:
+ f.write(line)
def issue(request, ca, capk):