From: W. Trevor King Date: Thu, 12 Apr 2012 14:43:19 +0000 (-0400) Subject: Add positional arguments to format strings for Python 2.6 compatibility. X-Git-Tag: 0.5~17 X-Git-Url: http://git.tremily.us/?p=pycomedi.git;a=commitdiff_plain;h=c61ddc600ad08c0b4cc5ccd6617287d186b7f207 Add positional arguments to format strings for Python 2.6 compatibility. For 2.7 and later, the positional arguments can be omitted, but Richard Höchenberger (and others?) wants to run pycomedi on 2.6. --- diff --git a/pycomedi/__init__.py b/pycomedi/__init__.py index cd118e1..4b12075 100644 --- a/pycomedi/__init__.py +++ b/pycomedi/__init__.py @@ -42,8 +42,8 @@ class PyComediError (Exception): self.comedi_msg = comedi_msg self.error_msg = error_msg if error_msg: - msg = '{} ({}): {} ({})'.format( + msg = '{0} ({1}): {2} ({3})'.format( function_name, error_msg, comedi_msg, ret) else: - msg = '{}: {} ({})'.format(function_name, comedi_msg, ret) + msg = '{0}: {1} ({2})'.format(function_name, comedi_msg, ret) super(PyComediError, self).__init__(msg)