From f9fc367427e30b7a3ca2ccad6144cb76b21f0257 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 14:36:22 +0200 Subject: Spare code cosmetics --- module/plugins/internal/OCR.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/internal/OCR.py') diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py index b24b3058b..5913e604d 100644 --- a/module/plugins/internal/OCR.py +++ b/module/plugins/internal/OCR.py @@ -128,6 +128,7 @@ class OCR(Plugin): try: with open(tmpTxt.name, 'r') as f: self.result_captcha = f.read().replace("\n", "") + except Exception: self.result_captcha = "" @@ -194,6 +195,7 @@ class OCR(Plugin): count += 1 if pixels[x, y - 1] != 255: count += 1 + except Exception: pass -- cgit v1.2.3 From 34244c7a49b099d30456e0bd80cf26a2be3a3208 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 23:35:58 +0200 Subject: Spare improvements and fixes (2) --- module/plugins/internal/OCR.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'module/plugins/internal/OCR.py') diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py index 5913e604d..3e5afae69 100644 --- a/module/plugins/internal/OCR.py +++ b/module/plugins/internal/OCR.py @@ -12,7 +12,6 @@ import logging import os import subprocess # import tempfile -import traceback from module.plugins.internal.Plugin import Plugin from module.utils import save_join as fs_join @@ -138,10 +137,9 @@ class OCR(Plugin): os.remove(tmpTxt.name) if subset and (digits or lowercase or uppercase): os.remove(tmpSub.name) + except OSError, e: self.log_warning(e) - if self.pyload.debug: - traceback.print_exc() def recognize(self, name): -- cgit v1.2.3