Fix string concatenation to fix error messages

Without using parentheses, the strings are not joined.
This commit is contained in:
Daniel Albert
2018-07-02 20:57:45 +00:00
parent 29b680ef84
commit 8cea56aceb

View File

@@ -48,12 +48,12 @@ class PyOCR(OCRBackendBase):
builder=pyocr.builders.TextBuilder()
)
except Exception as exception:
error_message = 'Exception calling pyocr with language option: '
'{}; {}'.format(self.language, exception)
error_message = ('Exception calling pyocr with language option: '
'{}; {}').format(self.language, exception)
if self.language not in self.languages:
error_message = '{}\nThe requested OCR language "{}" is not '
'available and needs to be installed.\n'.format(
error_message = ('{}\nThe requested OCR language "{}" is not '
'available and needs to be installed.\n').format(
error_message, self.language
)