src/reportlab/lib/yaml.py
changeset 3326 ce725978d11c
parent 2964 32352db0d71e
child 3617 ae5744e97c42
--- a/src/reportlab/lib/yaml.py	Sat Feb 06 09:24:08 2010 +0000
+++ b/src/reportlab/lib/yaml.py	Mon Feb 08 18:17:33 2010 +0000
@@ -101,13 +101,12 @@
 
             #is it a parser method?
             if hasattr(self.__class__, cmd):
-                method = eval('self.'+cmd)
                 #this was very bad; any type error in the method was hidden
                 #we have to hack the traceback
                 try:
-                    apply(method, tuple(args))
+                    getattr(self,cmd)(*args)
                 except TypeError, err:
-                    sys.stderr.write("Parser method: apply(%s,%s) %s at line %d\n" % (cmd, tuple(args), err, self._lineNo))
+                    sys.stderr.write("Parser method: %s(*%s) %s at line %d\n" % (cmd, args, err, self._lineNo))
                     raise
             else:
                 # assume it is a paragraph style -
@@ -180,9 +179,9 @@
 
 
 if __name__=='__main__': #NORUNTESTS
-    if len(sys.argv) <> 2:
+    if len(sys.argv) != 2:
         results = parseText(__doc__)
     else:
         results = parseFile(sys.argv[1])
     import pprint
-    pprint.pprint(results)
\ No newline at end of file
+    pprint.pprint(results)