Skip to content

Commit edca436

Browse files
committed
Rename 'preload_plugins' to 'load_plugin_modules'
Plugins are not preloaded (in the sense of the forkserver importing modules before it forks to start the worker function), they are loaded just before we unpickle the worker function.
1 parent d43edf7 commit edca436

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

plugins/SedRegex/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def _replacer(self, irc, msg, target, pattern, replacement, count,
314314
try:
315315
result = process(apply_substitution_to_first_matching_message,
316316
pattern, replacement, messages, count,
317-
preload_plugins=["SedRegex"], **kwargs)
317+
load_plugin_modules=["SedRegex"], **kwargs)
318318
if result:
319319
(m, subst) = result
320320
return self._format_result(irc, msg, m, subst)

src/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ def _process_target(f, q, heap_size, *args, **kwargs):
103103
except Exception as e:
104104
q.put([True, e])
105105

106-
def _process_queued_target(f_q, q, heap_size, *args, preload_plugins, **kwargs):
106+
def _process_queued_target(f_q, q, heap_size, *args, load_plugin_modules, **kwargs):
107107
"""Called by :func:`process` on non-``fork`` multiprocessing contexts"""
108108
from .plugin import loadPluginModule
109109

110-
for plugin in preload_plugins:
110+
for plugin in load_plugin_modules:
111111
loadPluginModule(plugin, ignoreDeprecation=True)
112112

113113
f = f_q.get()
@@ -132,7 +132,7 @@ def process(f, *args, **kwargs):
132132
if world.disableMultiprocessing:
133133
pn = kwargs.pop('pn', 'Unknown')
134134
cn = kwargs.pop('cn', 'unknown')
135-
kwargs.pop('preload_plugins', None)
135+
kwargs.pop('load_plugin_modules', None)
136136
try:
137137
return f(*args, **kwargs)
138138
except Exception as e:
@@ -154,7 +154,7 @@ def process(f, *args, **kwargs):
154154
multiprocessing.context.ForkContext):
155155
# no need to pickle f
156156
targetArgs = (f, q, heap_size) + args
157-
kwargs.pop('preload_plugins', None)
157+
kwargs.pop('load_plugin_modules', None)
158158
p = callbacks.CommandProcess(target=_process_target,
159159
args=targetArgs, kwargs=kwargs)
160160
else:

0 commit comments

Comments
 (0)