Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Jan 6, 2024
1 parent 6f10726 commit 2444c35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/grass/pygrass/modules/interface/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __init__(self, xparameter=None, diz=None):
try:
# Check for integer ranges: "3-30" or float ranges: "0.0-1.0"
isrange = re.match(
r"(?P<min>-*\d+.*\d*)-(?P<max>\d+.*\d*)", diz["values"][0]
r"(?P<min>-?(?:\d*\.)?\d+)?-(?P<max>-?(?:\d*\.)?\d+)?", diz["values"][0]
)
if isrange:
mn, mx = isrange.groups()
Expand Down
2 changes: 1 addition & 1 deletion python/grass/script/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def convert_xml_to_utf8(xml_text):

# modify: fetch encoding from the interface description text(xml)
# e.g. <?xml version="1.0" encoding="GBK"?>
pattern = re.compile(br'<\?xml[^>]*\Wencoding="([^"]*)"[^>]*\?>')
pattern = re.compile(rb'<\?xml[^>]*\Wencoding="([^"]*)"[^>]*\?>')
m = re.match(pattern, xml_text)
if m is None:
return xml_text.encode("utf-8") if xml_text else None
Expand Down

0 comments on commit 2444c35

Please sign in to comment.