Skip to content

Commit

Permalink
Remove misplaced flags from re.sub() call (#153)
Browse files Browse the repository at this point in the history
The 4th argument of re.sub() is maximum number of substitutions,
not flags.

Moreover, re.MULTILINE affects only semantics of ^ and $,
so it wouldn't have any effect on this regular expression.
  • Loading branch information
jwilk authored and jbarlow83 committed Apr 20, 2017
1 parent a1033cd commit 2846fb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocrmypdf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def available_cpu_count():


def cleanup_ruffus_error_message(msg):
msg = re.sub(r'\s+', r' ', msg, re.MULTILINE)
msg = re.sub(r'\s+', r' ', msg)
msg = re.sub(r"\((.+?)\)", r'\1', msg)
msg = msg.strip()
return msg
Expand Down

0 comments on commit 2846fb4

Please sign in to comment.