forked from goodboy/tractor
Add help msg for non `__main__` modules as well
parent
24b6cc0209
commit
65a9f69d6c
|
@ -509,13 +509,20 @@ class Actor:
|
||||||
mne = ModuleNotExposed(*err.args)
|
mne = ModuleNotExposed(*err.args)
|
||||||
|
|
||||||
if ns == '__main__':
|
if ns == '__main__':
|
||||||
msg = (
|
modpath = '__name__'
|
||||||
"\n\nMake sure you exposed the current module using:\n\n"
|
else:
|
||||||
"ActorNursery.start_actor(<name>, enable_modules="
|
modpath = f"'{ns}'"
|
||||||
"[__name__])"
|
|
||||||
)
|
|
||||||
|
|
||||||
mne.msg += msg
|
msg = (
|
||||||
|
"\n\nMake sure you exposed the target module, `{ns}`, "
|
||||||
|
"using:\n"
|
||||||
|
"ActorNursery.start_actor(<name>, enable_modules=[{mod}])"
|
||||||
|
).format(
|
||||||
|
ns=ns,
|
||||||
|
mod=modpath,
|
||||||
|
)
|
||||||
|
|
||||||
|
mne.msg += msg
|
||||||
|
|
||||||
raise mne
|
raise mne
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue