Skip to content

Commit

Permalink
Fix messageformat not passed to thread
Browse files Browse the repository at this point in the history
The message format is stored as a global variable, but globals are not
shared between processes. Therefore, we must explicitly pass it as a
parameter.

Closes #472.
  • Loading branch information
skycaptain authored and priv-kweihmann committed Jan 5, 2024
1 parent a9bc359 commit 447d10c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions oelint_adv/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from oelint_adv.cls_rule import Rule
from oelint_adv.cls_rule import load_rules
from oelint_adv.color import set_colorize
from oelint_adv.rule_file import get_messageformat
from oelint_adv.rule_file import get_rulefile
from oelint_adv.rule_file import get_suppressions
from oelint_adv.rule_file import set_inlinesuppressions
Expand Down Expand Up @@ -281,7 +282,9 @@ def flatten(list_):
return flat


def group_run(group, quiet, fix, jobs, rules, nobackup):
def group_run(group, quiet, fix, jobs, rules, nobackup, messageformat):
set_messageformat(messageformat)

fixedfiles = []
stash = Stash(quiet)
for f in group:
Expand Down Expand Up @@ -360,7 +363,8 @@ def rule_applicable(rule):
with mp.Pool(processes=args.jobs) as pool:
try:
issues = flatten(pool.map(partial(group_run, quiet=args.quiet, fix=args.fix,
jobs=args.jobs, rules=rules, nobackup=args.nobackup), groups))
jobs=args.jobs, rules=rules, nobackup=args.nobackup,
messageformat=get_messageformat()), groups))
finally:
pool.close()
pool.join()
Expand Down

0 comments on commit 447d10c

Please sign in to comment.