Trying to execute someone’s code, getting a syntax error. No idea why 🙁
def GetParsers( self, systags ):
childparsers = reduce( lambda a,b : a+b, [[]] + [ plugin.GetParsers( systags ) for plugin in self.plugins ] )
parsers = [ p for plist in [ self.parsers[t] for t in systags if self.parsers.has_key(t) ] for p in plist ]
return reduce( lambda a,b : ( a+[b] if not b in a else a ), [[]] + parsers + childparsers )
And the error is
File "base.py", line 100
return reduce( lambda a,b : ( a+[b] if not b in a else a ), [[]] + parsers + childparsers )
Python Version
Python 2.2.3 (#1, May 1 2006, 12:33:49)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-54)] on linux2
^
Conditional expressions were added in 2.5 (source) – you have 2.2. So no conditional expressions for you, I fear. They just don’t exist yet in that version. Definitively update (not only for this little change, there are literally thousands of them since ’06) if you can.