Skip to content
Snippets Groups Projects
Commit f04008e1 authored by Martin Bauer's avatar Martin Bauer
Browse files

fields() function regex parsing now works also with python < 3.6

parent 7c6bcb00
No related merge requests found
......@@ -763,7 +763,7 @@ def _parse_description(description):
def parse_part1(d):
result = field_description_regex.match(d)
while result:
name, index_str = result[1], result[2]
name, index_str = result.group(1), result.group(2)
index = tuple(int(e) for e in index_str.split(",")) if index_str else ()
yield name, index
d = d[result.end():]
......@@ -772,7 +772,7 @@ def _parse_description(description):
def parse_part2(d):
result = type_description_regex.match(d)
if result:
data_type_str, size_info = result[1], result[2].strip().lower()
data_type_str, size_info = result.group(1), result.group(2).strip().lower()
if data_type_str is None:
data_type_str = 'float64'
data_type_str = data_type_str.lower().strip()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment