From d70e3d37531b6298433d888c11384f9b331d0968 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 29 Jul 2016 13:31:24 -0700 Subject: [PATCH] ruffus exceptions: for clarity only, don't iterate strings It's a good habit to ensure any iterator test is explicit about allowing or disallowing strings. --- ocrmypdf/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocrmypdf/main.py b/ocrmypdf/main.py index e7c09e1d..03104df1 100755 --- a/ocrmypdf/main.py +++ b/ocrmypdf/main.py @@ -1142,7 +1142,7 @@ def traverse_ruffus_exception(e): if isinstance(e[0], str) and len(e) == 5: return do_ruffus_exception(e) - elif hasattr(e, '__iter__'): + elif hasattr(e, '__iter__') and not isinstance(e, str): for exc in e: return traverse_ruffus_exception(exc)