Fix a bug with "points" attribute of "polyline/polygon" starting with a negative number.
In this case "len(nums) = 0" and "nums[len(nums)-1]" triggered an "IndexError: list index out of range"
This commit is contained in:
parent
f0c69b827e
commit
ab1aa0e2f8
1 changed files with 4 additions and 2 deletions
|
|
@ -2145,8 +2145,10 @@ def parseListOfPoints(s):
|
||||||
else:
|
else:
|
||||||
# unless we accidentally split a number that was in scientific notation
|
# unless we accidentally split a number that was in scientific notation
|
||||||
# and had a negative exponent (500.00e-1)
|
# and had a negative exponent (500.00e-1)
|
||||||
|
prev = "";
|
||||||
|
if len(nums):
|
||||||
prev = nums[len(nums)-1]
|
prev = nums[len(nums)-1]
|
||||||
if prev[len(prev)-1] in ['e', 'E']:
|
if prev and prev[len(prev)-1] in ['e', 'E']:
|
||||||
nums[len(nums)-1] = prev + '-' + negcoords[j]
|
nums[len(nums)-1] = prev + '-' + negcoords[j]
|
||||||
else:
|
else:
|
||||||
nums.append( '-'+negcoords[j] )
|
nums.append( '-'+negcoords[j] )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue