X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=cipher.py;h=bc173a75200e5c1a997ec7d792f782633e154ff2;hb=e6332a16567643e66c2a491b94994f9482384d34;hp=f271120ccefcc7a687edd63964653547199c404c;hpb=a89d923f5a5e225bacfcbec82f01f6cc236a6ac2;p=cipher-tools.git diff --git a/cipher.py b/cipher.py index f271120..bc173a7 100644 --- a/cipher.py +++ b/cipher.py @@ -516,7 +516,9 @@ def keyword_break_mp(message, helper_args = [(message, word, wrap, metric, target_counts, message_frequency_scaling) for word in wordlist for wrap in range(3)] - breaks = pool.starmap(keyword_break_one, helper_args, chunksize) # Gotcha: the helper function here needs to be defined at the top level (limitation of Pool.starmap) + # Gotcha: the helper function here needs to be defined at the top level + # (limitation of Pool.starmap) + breaks = pool.starmap(keyword_break_one, helper_args, chunksize) return min(breaks, key=lambda k: k[1]) def keyword_break_one(message, keyword, wrap_alphabet, metric, target_counts,