• R/O
  • SSH
  • HTTPS

shibuya-trac: Commit


Commit MetaInfo

Revision826 (tree)
Zeit2012-06-10 12:02:28
Autorakihirox

Log Message

use ast.literal_eval instead of eval

Ändern Zusammenfassung

Diff

--- plugins/hudsontracplus/0.11/HudsonTracPlus/HudsonTracPlusPlugin.py (revision 825)
+++ plugins/hudsontracplus/0.11/HudsonTracPlus/HudsonTracPlusPlugin.py (revision 826)
@@ -88,6 +88,7 @@
8888 import calendar
8989 import urllib2
9090 import urlparse
91+import ast
9192 from datetime import datetime
9293 from trac.core import *
9394 from trac.config import Option, BoolOption, ListOption
@@ -197,7 +198,7 @@
197198
198199 hudson_api_url = self.hudson_url + 'api/python'
199200 try:
200- hudson_json = eval(self.url_opener.open(hudson_api_url).readline())
201+ hudson_json = ast.literal_eval(self.url_opener.open(hudson_api_url).readline())
201202 except:
202203 self.env.log.debug("hudson_api_url='%s'" % (hudson_api_url))
203204 return
@@ -208,7 +209,7 @@
208209
209210 job_api_url = get_job_url(job['url'] + 'api/python?depth=2&tree=builds[timestamp,result,url,number,description]', self.hudson_url)
210211 try:
211- json = eval(self.url_opener.open(job_api_url).readline())
212+ json = ast.literal_eval(self.url_opener.open(job_api_url).readline())
212213 except:
213214 self.env.log.debug("job_api_url='%s'" % (job_api_url))
214215 raise
Show on old repository browser