Commits

larsholmnielsen committed ae0e11a

Fix Python 2.4/5 compatibility issue.

  • Participants
  • Parent commits 667bb57

Comments (0)

Files changed (1)

src/invenio_devserver/webserver_ssl.py

     cert_file = base_path + '.crt'
     pkey_file = base_path + '.key'
 
-    with open(cert_file, 'w') as f:
-        f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
-    with open(pkey_file, 'w') as f:
-        f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey))
+    f = open(cert_file, 'w')
+    f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
+    f.close()
+    f = open(pkey_file, 'w')
+    f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey))
+    f.close()
 
     return cert_file, pkey_file