Add python3 support

This commit is contained in:
Raimon Esteve 2018-05-14 06:44:36 +00:00
commit 31d871d322
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class Company:
@classmethod
def get_private_key(cls, companies, name=None):
converter = buffer
converter = bytes
default = None
format_ = Transaction().context.pop(
'%s.%s' % (cls.__name__, name), '')

View File

@ -58,7 +58,7 @@ class LoadPKCS12(Wizard):
(company,) = Company.browse([company_id])
with BytesIO(self.start.pfx) as pfx:
try:
pkcs12 = load_pkcs12(pfx.read(), bytes(self.start.password))
pkcs12 = load_pkcs12(pfx.read(), self.start.password)
crt = dump_certificate(FILETYPE_PEM, pkcs12.get_certificate())
key = dump_privatekey(FILETYPE_PEM, pkcs12.get_privatekey())
Company.write([company], {