Use a clean getattr() instead of eval().
authorRobert Lehmann <mail@robertlehmann.de>
Fri, 26 Nov 2010 08:46:52 +0000 (09:46 +0100)
committerRobert Lehmann <mail@robertlehmann.de>
Fri, 26 Nov 2010 08:46:52 +0000 (09:46 +0100)
libbe/command/list.py

index 06249a0d68dc3c0d44ef7cfffb643d8d416c432d..f348d5cb6cee0154b0dec068907a09a6600266da 100644 (file)
@@ -156,7 +156,7 @@ class List (libbe.command.Command):
                     raise libbe.command.UserError(
                         'Invalid sort on "%s".\nValid sorts:\n  %s'
                     % (cmp, '\n  '.join(AVAILABLE_CMPS)))
-            cmp_list.append(eval('libbe.bug.cmp_%s' % cmp))
+            cmp_list.append(getattr(libbe.bug, 'cmp_%s' % cmp))
         status = parse_status(params['status'])
         severity = parse_severity(params['severity'],
                                   important=params['important'])