comparison roundup/anypy/strings.py @ 6638:e1588ae185dc issue2550923_computed_property

merge from default branch. Fix travis.ci so CI builds don't error out
author John Rouillard <rouilj@ieee.org>
date Thu, 21 Apr 2022 16:54:17 -0400
parents 82f870433b18
children 8e118eb20d86
comparison
equal deleted inserted replaced
6508:85db90cc1705 6638:e1588ae185dc
140 140
141 141
142 def eval_import(s): 142 def eval_import(s):
143 """Evaluate a Python-2-style value imported from a CSV file.""" 143 """Evaluate a Python-2-style value imported from a CSV file."""
144 if _py3: 144 if _py3:
145 v = eval(s) 145 try:
146 v = eval(s)
147 except SyntaxError:
148 # handle case where link operation reports id a long int
149 # ('issue', 5002L, "status") rather than as a string.
150 # This was a bug that existed and was fixed before or with v1.2.0
151 import re
152 v = eval(re.sub(r', ([0-9]+)L,',r', \1,', s))
153
146 if isinstance(v, str): 154 if isinstance(v, str):
147 return v.encode('iso-8859-1').decode('utf-8') 155 return v.encode('iso-8859-1').decode('utf-8')
148 elif isinstance(v, dict): 156 elif isinstance(v, dict):
149 v_mod = {} 157 v_mod = {}
150 for key, value in v.items(): 158 for key, value in v.items():

Roundup Issue Tracker: http://roundup-tracker.org/