From 97b889f5b71e1231fe0062c14c5fcad75bc79c2d Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Sun, 1 Oct 2017 00:27:17 +0300 Subject: [PATCH] py3k: Use compatible exception syntax --- certidude/api/request.py | 2 +- certidude/api/scep.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/certidude/api/request.py b/certidude/api/request.py index 97d6ceb..c1af6fc 100644 --- a/certidude/api/request.py +++ b/certidude/api/request.py @@ -85,7 +85,7 @@ class RequestListResource(object): try: renewal_signature = b64decode(renewal_header) - except TypeError, ValueError: + except (TypeError, ValueError): logger.error(u"Renewal failed, bad signature supplied for %s", common_name) reasons.append("Renewal failed, bad signature supplied") else: diff --git a/certidude/api/scep.py b/certidude/api/scep.py index cf92f58..dff8633 100644 --- a/certidude/api/scep.py +++ b/certidude/api/scep.py @@ -139,7 +139,7 @@ class SCEPResource(object): signed_certificate = asymmetric.load_certificate(buf) content = signed_certificate.asn1.dump() - except SCEPError, e: + except SCEPError as e: attr_list.append(cms.CMSAttribute({ 'type': u"fail_info", 'values': ["%d" % e.code]