From 1d20ef4253474c316485ee051c3b61d504c3e174 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 12 May 2021 15:36:52 +0300 Subject: python 3 fix --- servo/forms/admin.py | 2 +- servo/views/gsx.py | 4 ++-- servo/views/note.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/servo/forms/admin.py b/servo/forms/admin.py index d0c284a..21fd988 100644 --- a/servo/forms/admin.py +++ b/servo/forms/admin.py @@ -261,7 +261,7 @@ class TemplateForm(BaseModelForm): content = self.cleaned_data.get('content') try: template.Template(content) - except template.TemplateSyntaxError, e: + except template.TemplateSyntaxError as e: raise forms.ValidationError(_('Syntax error in template: %s') % e) return content diff --git a/servo/views/gsx.py b/servo/views/gsx.py index 2f0f057..52909fa 100644 --- a/servo/views/gsx.py +++ b/servo/views/gsx.py @@ -95,7 +95,7 @@ def add_part(request, repair, part): data = {'part': part.part_number, 'repair': rep.confirmation} msg = _("Part %(part)s added to repair %(repair)s") % data messages.success(request, msg) - except gsxws.GsxError, e: + except gsxws.GsxError as e: messages.error(request, e) return redirect(rep.order) @@ -124,7 +124,7 @@ def remove_part(request, repair, part): data = {'part': part.code, 'repair': rep.confirmation} msg = _(u"Part %(part)s removed from %(repair)s") % data messages.success(request, msg) - except gsxws.GsxError, e: + except gsxws.GsxError as e: messages.error(request, e) return redirect(rep.order) diff --git a/servo/views/note.py b/servo/views/note.py index 9672a84..782ef4e 100644 --- a/servo/views/note.py +++ b/servo/views/note.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import json -import StringIO +from io import StringIO from gsxws import escalations from django import template -- cgit v1.2.3