[Tutor] (no subject)

Steven D'Aprano steve at pearwood.info
Sun May 13 01:29:58 CEST 2012

Keitaro Kaoru wrote:
> hey i keep having a problem with adding commands.. i get this error message
> Traceback (most recent call last):
>   File "bot.py", line 23, in <module>
>     import modules.core, modules.ai, modules.dict, modules.fun, modules.kc,
> modules.games, modules.lulz2, modules.modding, modules.meta, modules.mpd,
> modules.post, modules.poll, modules.util, modules.yt
>   File "/home/digest/digest/modules/core.py", line 170
>     def pm(mgr, room, user, msg, args):
>       ^
> SyntaxError: invalid syntax
> worked fine before i edited a command in front of it...

Hint: when you change something, and things break, check the thing you changed.

In this case, I would expect that you haven't closed a set of brackets: you're 
probably missing a ) ] or }, most likely a ). The parser sometimes can't 
detect missing close-brackets until the line *following* the error.


More information about the Tutor mailing list