Mercurial > p > roundup > code
diff 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 |
line wrap: on
line diff
--- a/roundup/anypy/strings.py Fri Oct 08 00:37:16 2021 -0400 +++ b/roundup/anypy/strings.py Thu Apr 21 16:54:17 2022 -0400 @@ -142,7 +142,15 @@ def eval_import(s): """Evaluate a Python-2-style value imported from a CSV file.""" if _py3: - v = eval(s) + try: + v = eval(s) + except SyntaxError: + # handle case where link operation reports id a long int + # ('issue', 5002L, "status") rather than as a string. + # This was a bug that existed and was fixed before or with v1.2.0 + import re + v = eval(re.sub(r', ([0-9]+)L,',r', \1,', s)) + if isinstance(v, str): return v.encode('iso-8859-1').decode('utf-8') elif isinstance(v, dict):
